/** * Gets the attributeType at this xPath, if the specified attributeType * does not exist then null is returned. * * @param xPath XPath pointer to attribute type. * * @return True if attribute exists. */ public AttributeType getAttributeType(String xPath) { return featureType.getAttributeType(xPath); }
/** * Gets the attributeType at the specified index. * * @param position the position of the attribute to check. * * @return The attribute type at the specified position. */ public AttributeType getAttributeType(int position) { return featureType.getAttributeType(position); }
public static int findGeomIndex(final FeatureType _ftype) { int t; // fill in each of the column defs for (t = 0; t < _ftype.getAttributeCount(); t++) { if (_ftype.getAttributeType(t) instanceof GeometryAttributeType) { return t; } } return -1; }
/** * @see org.geotools.data.AttributeReader#getAttributeType(int) */ public AttributeType getAttributeType(int index) throws ArrayIndexOutOfBoundsException { return featureTypeInfo.getSchema().getAttributeType(index); }
/** * @return {@link Boolean#TRUE} if the <code>feature</code>'s * {@link FeatureType} contains an attribute named as the property * name passed as this function argument, {@link Boolean#FALSE} * otherwise. */ public Object evaluate(Feature feature) { String propName = getPropertyName(); AttributeType attributeType = feature.getFeatureType().getAttributeType(propName); return Boolean.valueOf(attributeType != null); }
/** * Returns the qname with prefix as <code>null</code>, and local part the name of the * feature attribute. */ public QName getName() { return new QName( null, featureType.getAttributeType( index ).getName() ); }
public Object get(Object object, String xpath, Class target) { xpath = stripPrefix(xpath); if ( object instanceof Feature ) { return ((Feature) object).getAttribute( xpath ); } if ( object instanceof FeatureType ) { return ((FeatureType) object).getAttributeType( xpath ); } return null; }
public boolean canHandle(Object object, String xpath, Class target) { xpath = stripPrefix(xpath); if ( object instanceof Feature ) { return ((Feature) object).getAttribute( xpath ) != null; } if ( object instanceof FeatureType ) { return ((FeatureType) object).getAttributeType( xpath ) != null; } return false; }
public UniqueVisitor(int attributeTypeIndex, FeatureType type) throws IllegalFilterException { FilterFactory factory = CommonFactoryFinder.getFilterFactory(null); expr = factory.property(type.getAttributeType(attributeTypeIndex).getName()); }
public UniqueVisitor(String attrName, FeatureType type) throws IllegalFilterException { FilterFactory factory = CommonFactoryFinder.getFilterFactory(null); expr = factory.property(type.getAttributeType(attrName).getName()); }
public String[] getPropertyNames(Object object) { Feature feature = (Feature) object; FeatureType featureType = feature.getFeatureType(); //set is ok because jxpath ignores order String[] propertyNames = new String[ featureType.getAttributeCount() ]; for ( int i = 0; i < propertyNames.length; i++ ) { propertyNames[ i ] = featureType.getAttributeType( i ).getName(); } return propertyNames; }
public MinVisitor(String attrName, FeatureType type) throws IllegalFilterException { FilterFactory factory = CommonFactoryFinder.getFilterFactory(null); expr = factory.property(type.getAttributeType(attrName).getName()); }
public MaxVisitor(int attributeTypeIndex, FeatureType type) throws IllegalFilterException { FilterFactory factory = CommonFactoryFinder.getFilterFactory(null); expr = factory.property(type.getAttributeType(attributeTypeIndex).getName()); }
public MinVisitor(int attributeTypeIndex, FeatureType type) throws IllegalFilterException { FilterFactory factory = CommonFactoryFinder.getFilterFactory(null); expr = factory.property(type.getAttributeType(attributeTypeIndex).getName()); }
public String[] getPropertyNames(Object object) { Feature feature = (Feature) object; FeatureType featureType = feature.getFeatureType(); //set is ok because jxpath ignores order String[] propertyNames = new String[featureType.getAttributeCount()]; for (int i = 0; i < propertyNames.length; i++) { propertyNames[i] = featureType.getAttributeType(i).getLocalName(); } return propertyNames; }
/** * Returns the qname with prefix as <code>null</code>, and local part the name of the * feature attribute. */ public QName getName() { return (index != -1) ? new QName(null, feature.getFeatureType().getAttributeType(index).getLocalName()) : new QName(null, "fid"); }
/** * Returns the qname with prefix as <code>null</code>, and local part the name of the * feature attribute. */ public QName getName() { return index != -1 ? new QName( null, feature.getFeatureType().getAttributeType( index ).getName() ) : new QName( null, "fid" ); }
public SumVisitor(int attributeTypeIndex, FeatureType type) throws IllegalFilterException { FilterFactory factory = CommonFactoryFinder.getFilterFactory(null); AttributeType attributeType = type.getAttributeType(attributeTypeIndex); expr = factory.property(attributeType.getName()); createStrategy(attributeType.getType()); }
public void testGetFeatureStoreModifyFeatures2() throws IOException { FeatureStore road = (FeatureStore) data.getFeatureSource("ROAD"); AttributeType name = roadType.getAttributeType("NAME"); road.modifyFeatures(new AttributeType[] { name, }, new Object[] { "changed", }, rd1Filter); FeatureCollection results = road.getFeatures(rd1Filter); assertEquals("changed", results.features().next().getAttribute("NAME")); }
public void testGetFeatureStoreModifyFeatures1() throws IOException { FeatureStore road = (FeatureStore) data.getFeatureSource("ROAD"); AttributeType name = roadType.getAttributeType("NAME"); road.modifyFeatures(name, "changed", rd1Filter); FeatureCollection results = road.getFeatures(rd1Filter); assertEquals("changed", results.features().next().getAttribute("NAME")); }