/** * Get the type registry, creating it first if necessary. * * @return the type registry. Guaranteed non-null. */ private FeatureTypeRegistry getFeatureTypeRegistry() { if (this.typeRegistry == null) { this.typeRegistry = new FeatureTypeRegistry( new ComplexFeatureTypeFactoryImpl(), new GmlFeatureTypeRegistryConfiguration(null)); } return this.typeRegistry; }
public NonFeatureTypeProxy(final ComplexType type, final FeatureTypeMapping mapping, Collection<PropertyDescriptor> schema) { super(type.getName(), null); subject = type; AttributeDescriptor originalTarget = mapping.getTargetFeature(); int maxOccurs = originalTarget.getMaxOccurs(); int minOccurs = originalTarget.getMinOccurs(); boolean nillable = originalTarget.isNillable(); Object defaultValue = originalTarget.getDefaultValue(); Name name = originalTarget.getName(); // create a new descriptor with the wrapped type and set it to the mapping ComplexFeatureTypeFactoryImpl typeFactory = new ComplexFeatureTypeFactoryImpl(); AttributeDescriptor descriptor = typeFactory.createAttributeDescriptor(this, name, minOccurs, maxOccurs, nillable, defaultValue); descriptor.getUserData().putAll(originalTarget.getUserData()); mapping.setTargetFeature(descriptor); this.descriptors = schema; }
/** * Sole constructor * * @param type * The underlying non feature type */ public NonFeatureTypeProxy(final ComplexType type, final FeatureTypeMapping mapping) { super(type.getName(), null); subject = type; AttributeDescriptor originalTarget = mapping.getTargetFeature(); int maxOccurs = originalTarget.getMaxOccurs(); int minOccurs = originalTarget.getMinOccurs(); boolean nillable = originalTarget.isNillable(); Object defaultValue = originalTarget.getDefaultValue(); Name name = originalTarget.getName(); // create a new descriptor with the wrapped type and set it to the mapping ComplexFeatureTypeFactoryImpl typeFactory = new ComplexFeatureTypeFactoryImpl(); AttributeDescriptor descriptor = typeFactory.createAttributeDescriptor(this, name, minOccurs, maxOccurs, nillable, defaultValue); descriptor.getUserData().putAll(originalTarget.getUserData()); mapping.setTargetFeature(descriptor); // smuggle FEATURE_LINK descriptor descriptors = new ArrayList<PropertyDescriptor>(subject.getDescriptors()) { { add(ComplexFeatureConstants.FEATURE_CHAINING_LINK); } }; }
public FeatureTypeRegistry(NamespaceSupport namespaces) { if (namespaces != null) { GML = new GMLHandler(namespaces.getURI("gml")); } else { GML = new GMLHandler(null); } schemas = new ArrayList<SchemaIndex>(); typeFactory = new ComplexFeatureTypeFactoryImpl(); descriptorRegistry = new HashMap<Name, AttributeDescriptor>(); typeRegistry = new HashMap<Name, AttributeType>(); anonTypeRegistry = new HashMap<Name, AttributeType>(); processingTypes = new Stack<Name>(); if (FOUNDATION_TYPES.isEmpty()) { createFoundationTypes(); } typeRegistry.putAll(FOUNDATION_TYPES); descriptorRegistry.putAll(FOUNDATION_DESCRIPTORS); }