@Override public AttributeTypeInfo createAttribute() { return delegate.createAttribute(); }
@Test public void testEqualsWithAttributes() { CatalogFactory factory = catalog.getFactory(); FeatureTypeInfoImpl ft1 = (FeatureTypeInfoImpl) factory.createFeatureType(); FeatureTypeInfoImpl ft2 = (FeatureTypeInfoImpl) factory.createFeatureType(); ft1.setName("featureType"); ft2.setName("featureType"); AttributeTypeInfo at1 = factory.createAttribute(); AttributeTypeInfo at2 = factory.createAttribute(); at1.setName("attribute"); at2.setName("attribute"); at1.setFeatureType(ft1); at2.setFeatureType(ft2); ft1.setAttributes(Collections.singletonList(at1)); ft2.setAttributes(Collections.singletonList(at2)); assertEquals(ft1, ft2); } }
/** * Extracts the AttributeTypeInfo by copying them from the specified feature type. * * @param ft The schema to be harvested * @param info The optional feature type info from which all the attributes belong to */ public List<AttributeTypeInfo> getAttributes(FeatureType ft, FeatureTypeInfo info) { List<AttributeTypeInfo> attributes = new ArrayList<AttributeTypeInfo>(); for (PropertyDescriptor pd : ft.getDescriptors()) { AttributeTypeInfo att = catalog.getFactory().createAttribute(); att.setFeatureType(info); att.setName(pd.getName().getLocalPart()); att.setMinOccurs(pd.getMinOccurs()); att.setMaxOccurs(pd.getMaxOccurs()); att.setNillable(pd.isNillable()); att.setBinding(pd.getType().getBinding()); int length = FeatureTypes.getFieldLength(pd); if (length > 0) { att.setLength(length); } attributes.add(att); } return attributes; }
public List<AttributeTypeInfo> loadAttributes(FeatureTypeInfo info) throws IOException { List<AttributeTypeInfo> attributes = new ArrayList(); FeatureType ft = getFeatureType(info); for (PropertyDescriptor pd : ft.getDescriptors()) { AttributeTypeInfo att = catalog.getFactory().createAttribute(); att.setFeatureType(info); att.setName(pd.getName().getLocalPart()); att.setMinOccurs(pd.getMinOccurs()); att.setMaxOccurs(pd.getMaxOccurs()); att.setNillable(pd.isNillable()); att.setBinding(pd.getType().getBinding()); int length = FeatureTypes.getFieldLength(pd); if (length > 0) { att.setLength(length); } attributes.add(att); } return attributes; }
AttributeTypeInfo att = factory.createAttribute(); att.setName(ad.getLocalName()); att.setBinding(ad.getType().getBinding());
List<AttributeTypeInfo> attributes = ftinfo.getAttributes(); for (AttributeDescriptor ad : featureType.getAttributeDescriptors()) { AttributeTypeInfo att = factory.createAttribute(); att.setName(ad.getLocalName()); att.setBinding(ad.getType().getBinding());
List<AttributeTypeInfo> attributes = ftinfo.getAttributes(); for (AttributeDescriptor ad : featureType.getAttributeDescriptors()) { AttributeTypeInfo att = factory.createAttribute(); att.setName(ad.getLocalName()); att.setBinding(ad.getType().getBinding());
List<AttributeTypeInfo> attributes = ftinfo.getAttributes(); for (AttributeDescriptor ad : featureType.getAttributeDescriptors()) { AttributeTypeInfo att = factory.createAttribute(); att.setName(ad.getLocalName()); att.setBinding(ad.getType().getBinding());
SimpleFeatureType schema = featureSource.getSchema(); for (AttributeDescriptor ad : schema.getAttributeDescriptors()) { AttributeTypeInfo att = factory.createAttribute(); att.setName(ad.getLocalName()); att.setBinding(ad.getType().getBinding());
SimpleFeatureType schema = featureSource.getSchema(); for (AttributeDescriptor ad : schema.getAttributeDescriptors()) { AttributeTypeInfo att = factory.createAttribute(); att.setName(ad.getLocalName()); att.setBinding(ad.getType().getBinding());