Esempio n. 1
0
  @Override
  public Object copyTo(Object target, CopyBuilder copyBuilder) {
    Address copy = (target == null) ? new Address() : (Address) target;
    super.copyTo(copy, copyBuilder);

    if (isSetXalAddress()) {
      copy.setXalAddress((XalAddressProperty) copyBuilder.copy(xalAddress));
      if (copy.getXalAddress() == xalAddress) xalAddress.setParent(this);
    }

    if (isSetMultiPoint()) {
      copy.setMultiPoint((MultiPointProperty) copyBuilder.copy(multiPoint));
      if (copy.getMultiPoint() == multiPoint) multiPoint.setParent(this);
    }

    if (isSetGenericApplicationPropertyOfAddress()) {
      for (ADEComponent part : ade) {
        ADEComponent copyPart = (ADEComponent) copyBuilder.copy(part);
        copy.addGenericApplicationPropertyOfAddress(copyPart);

        if (part != null && copyPart == part) part.setParent(this);
      }
    }

    return copy;
  }
Esempio n. 2
0
  public String getInheritedSrsName() {
    if (srsName == null) {
      Child child = this;
      ModelObject parent = null;

      while ((parent = child.getParent()) != null) {
        if (parent instanceof AbstractGeometry)
          return ((AbstractGeometry) parent).getInheritedSrsName();
        else if (parent instanceof AbstractFeature) {
          AbstractFeature feature = (AbstractFeature) parent;
          if (feature.isSetBoundedBy()
              && feature.getBoundedBy().isSetEnvelope()
              && feature.getBoundedBy().getEnvelope().isSetSrsName())
            return feature.getBoundedBy().getEnvelope().getSrsName();
        }

        if (parent instanceof Child) child = (Child) parent;
        else break;
      }
    }

    return srsName;
  }