public LinearRingType marshalLinearRing(LinearRing src) { LinearRingType dest = gml.createLinearRingType(); marshalAbstractRing(src, dest); if (src.isSetPosList()) dest.setPosList(marshalDirectPositionList(src.getPosList())); if (src.isSetCoordinates()) dest.setCoordinates(marshalCoordinates(src.getCoordinates())); if (src.isSetCoord()) { for (Coord coord : src.getCoord()) dest.getCoord().add(marshalCoord(coord)); } if (src.isSetPosOrPointPropertyOrPointRep()) { for (PosOrPointPropertyOrPointRep item : src.getPosOrPointPropertyOrPointRep()) { if (item.isSetPos()) dest.getPosOrPointPropertyOrPointRep().add(marshalJAXBElement(item.getPos())); else if (item.isSetPointProperty()) dest.getPosOrPointPropertyOrPointRep().add(marshalJAXBElement(item.getPointProperty())); else if (item.isSetPointRep()) dest.getPosOrPointPropertyOrPointRep().add(marshalJAXBElement(item.getPointRep())); } } return dest; }
public LinearRing unmarshalLinearRing(LinearRingType src) { LinearRing dest = new LinearRing(); unmarshalAbstractRing(src, dest); if (src.isSetPosList()) dest.setPosList(unmarshalDirectPositionList(src.getPosList())); if (src.isSetCoordinates()) dest.setCoordinates(unmarshalCoordinates(src.getCoordinates())); if (src.isSetCoord()) { for (CoordType coord : src.getCoord()) dest.addCoord(unmarshalCoord(coord)); } if (src.isSetPosOrPointPropertyOrPointRep()) { for (JAXBElement<?> elem : src.getPosOrPointPropertyOrPointRep()) { try { ModelObject controlPoint = jaxb.unmarshal(elem); if (controlPoint instanceof DirectPosition) dest.addControlPoint(new PosOrPointPropertyOrPointRep((DirectPosition)controlPoint)); else if (controlPoint instanceof PointRep) dest.addControlPoint(new PosOrPointPropertyOrPointRep((PointRep)controlPoint)); else if (controlPoint instanceof PointProperty) dest.addControlPoint(new PosOrPointPropertyOrPointRep((PointProperty)controlPoint)); } catch (MissingADESchemaException e) { // } } } return dest; }