private List<Property> readAdditionalProperties( XMLStreamReaderWrapper xmlStream, GMLObjectType type, ICRS crs ) throws XMLParsingException, XMLStreamException, UnknownCRSException { List<Property> props = new ArrayList<Property>(); if ( type != null ) { while ( xmlStream.isStartElement() ) { QName propName = xmlStream.getName(); // TODO cope with order, cardinality and substitutable properties PropertyType pt = type.getPropertyDeclaration( propName ); if ( pt == null ) { String msg = "Geometry property element '" + propName + "' is not defined in application schema."; throw new XMLParsingException( xmlStream, msg ); } props.add( parseProperty( xmlStream, pt, crs ) ); XMLStreamUtils.nextElement( xmlStream ); } } return props; } }
private List<Property> readStandardProperties( XMLStreamReaderWrapper xmlStream, GMLObjectType type, ICRS crs ) throws XMLParsingException, XMLStreamException, UnknownCRSException { List<Property> props = new ArrayList<Property>(); nextElement( xmlStream ); while ( xmlStream.isStartElement() && isStandardProperty( xmlStream.getName() ) ) { if ( type != null ) { QName propName = xmlStream.getName(); // TODO check order, cardinality and substitutable properties PropertyType pt = type.getPropertyDeclaration( propName ); if ( pt == null ) { String msg = "GML standard property element '" + propName + "' is not defined in application schema!?"; throw new XMLParsingException( xmlStream, msg ); } Property prop = parseProperty( xmlStream, pt, crs ); props.add( prop ); } else { // handle without schema assistance -> skip skipElement( xmlStream ); } nextElement( xmlStream ); } return props; }
} else if ( child instanceof GenericXMLElement ) { GenericXMLElement xmlEl = (GenericXMLElement) child; PropertyType pt = ot.getPropertyDeclaration( xmlEl.getName() ); props.add( new GenericProperty( pt, xmlEl.getName(), null, xmlEl.getAttributes(), xmlEl.getChildren() ) ); } else {