private Map<String, Object> buildDummyFeatureTypeInfo(ComplexAttribute f) { Map<String, Object> dummy = new HashMap<String, Object>(); dummy.put("name", f.getType().getName().getLocalPart()); dummy.put("namespace", getNamespace(f.getType().getName())); dummy.put("prefix", getPrefix(f.getType().getName())); dummy.put("title", "Layer: " + f.getType().getName().getLocalPart()); dummy.put("abstract", "[No Abstract Provided]"); dummy.put("description", "[No Description Provided]"); dummy.put("keywords", new ArrayList<String>()); dummy.put("metadataLinks", new ArrayList<String>()); dummy.put("SRS", "[SRS]"); if (f instanceof Feature) { final GeometryDescriptor gd = ((Feature) f).getType().getGeometryDescriptor(); if (gd != null) { dummy.put("nativeCRS", gd.getCoordinateReferenceSystem()); } } return dummy; }
public Set entrySet() { if (entrySet == null) { entrySet = new LinkedHashSet<MapEntry>(); final Collection<PropertyDescriptor> types = feature.getType().getDescriptors(); Name attName; Map attributesMap; for (Iterator<PropertyDescriptor> iterator = types.iterator(); iterator.hasNext(); ) { attName = iterator.next().getName(); attributesMap = new AttributeMap(attName, feature); entrySet.add( new MapEntry<Object, Object>(attName.getLocalPart(), attributesMap)); } } return entrySet; } }
if (entrySet == null) { entrySet = new LinkedHashSet<MapEntry>(); final ComplexType featureType = feature.getType(); PropertyDescriptor attributeDescr = featureType.getDescriptor(attributeName); Property property = feature.getProperty(attributeName);
public AttributeNodeIterator(AttributeNodePointer pointer, Name name) { this.pointer = pointer; feature = (ComplexAttribute) pointer.getImmediateAttribute(); AttributeDescriptor descriptor = feature.getDescriptor(); Name attName = descriptor == null ? feature.getType().getName() : descriptor.getName(); if (attName.equals(name)) { children = Collections.<Property>singletonList(feature); } else { children = new ArrayList<Property>(feature.getProperties(name)); } position = children.size() > 0 ? 1 : 0; }
if (!(object.getType() instanceof FeatureTypeImpl)) {
Name typeName = featureWrapperAttribute.getType().getName(); ComplexAttribute nestedComplexAttribute = (ComplexAttribute) featureWrapperAttribute.getProperty(typeName);
} else if (property instanceof GeometryAttribute) { Object attType = complex.getType() .getUserData() .get(XSDTypeDefinition.class);
public AttributeNodeIterator(AttributeNodePointer pointer, Name name) { this.pointer = pointer; feature = (ComplexAttribute) pointer.getImmediateNode(); AttributeDescriptor descriptor = feature.getDescriptor(); Name attName = descriptor == null ? feature.getType().getName() : descriptor.getName(); if (attName.equals(name)) { children = Collections.<Property>singletonList(feature); } else { children = new ArrayList<Property>(feature.getProperties(name)); } position = children.size() > 0 ? 1 : 0; }
public AttributeNodeIterator(AttributeNodePointer pointer, Name name) { this.pointer = pointer; feature = (ComplexAttribute) pointer.getImmediateAttribute(); AttributeDescriptor descriptor = feature.getDescriptor(); Name attName = descriptor == null ? feature.getType().getName() : descriptor.getName(); if (attName.equals(name)) { children = Collections.<Property>singletonList(feature); } else { children = new ArrayList<Property>(feature.getProperties(name)); } position = children.size() > 0 ? 1 : 0; }
if (!(object.getType() instanceof FeatureTypeImpl)) {
Name typeName = featureWrapperAttribute.getType().getName(); ComplexAttribute nestedComplexAttribute = (ComplexAttribute) featureWrapperAttribute.getProperty(typeName);
/** Encode a complex attribute as a JSON object. */ private void encodeComplexAttribute( ComplexAttribute attribute, Map<NameImpl, String> attributes) { // get the attribute name and start a JSON object String name = attribute.getName().getLocalPart(); jsonWriter.key(name); if (attributes != null && !attributes.isEmpty()) { // we have some attributes to encode jsonWriter.array(); } // let's see if we have actually some properties to encode if (attribute.getProperties() != null && !attribute.getProperties().isEmpty()) { jsonWriter.object(); // encode the object properties, since this is not a top feature or a // chained feature we don't need to explicitly handle the geometry attribute encodeProperties(null, attribute.getType(), attribute.getProperties()); // end the attribute JSON object jsonWriter.endObject(); } if (attributes != null && !attributes.isEmpty()) { // encode the attributes list encodeAttributes(attributes); jsonWriter.endArray(); } }