Refine search
public void write() throws IOException { try { SimpleFeatureType target = getFeatureType(); for (int i = 0; i < target.getAttributeCount(); i++) { AttributeDescriptor at = target.getDescriptor(i); Object value = retyped.getAttribute(i); current.setAttribute(at.getLocalName(), value); } delegate.write(); } catch (IllegalAttributeException e) { throw (IOException) new IOException("Error occurred while retyping feature").initCause(e); } } }
AttributeDescriptor att = schema.getDescriptor(i); props.add(att.getLocalName()); if (schema.getDescriptor(queriedAtts[i]) != null) { allowedAtts.add(queriedAtts[i]); } else {
/** * Retrieve the specified column name * * @param column column index * @return the column name */ @Override public String getColumnName(int column) { if (column == 0) { return "FeatureIdentifer"; } return schema.getDescriptor(column - 1).getLocalName(); }
public SumAreaVisitor(int attributeTypeIndex, SimpleFeatureType type) throws IllegalFilterException { this(factory.property(type.getDescriptor(attributeTypeIndex).getLocalName())); }
public SumAreaVisitor(String attrName, SimpleFeatureType type) throws IllegalFilterException { this(factory.property(type.getDescriptor(attrName).getLocalName())); }
private Expression toExpression(int attributeTypeIndex, SimpleFeatureType type) { FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(null); AttributeDescriptor attribute = type.getDescriptor(attributeTypeIndex); if (attribute == null) { throw new IllegalArgumentException( "Attribute index '" + attributeTypeIndex + "' is not valid."); } return filterFactory.property(attribute.getLocalName()); }
private Expression toExpression(String attributeName, SimpleFeatureType type) { FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(null); AttributeDescriptor attribute = type.getDescriptor(attributeName); if (attribute == null) { throw new IllegalArgumentException("Attribute '" + attributeName + "' is not valid."); } return filterFactory.property(attribute.getLocalName()); }
public UniqueVisitor(int attributeTypeIndex, SimpleFeatureType type) throws IllegalFilterException { FilterFactory factory = CommonFactoryFinder.getFilterFactory(null); expr = factory.property(type.getDescriptor(attributeTypeIndex).getLocalName()); }
public MinVisitor(int attributeTypeIndex, SimpleFeatureType type) throws IllegalFilterException { FilterFactory factory = CommonFactoryFinder.getFilterFactory(null); expr = factory.property(type.getDescriptor(attributeTypeIndex).getLocalName()); }
public MedianVisitor(int attributeTypeIndex, SimpleFeatureType type) throws IllegalFilterException { FilterFactory factory = CommonFactoryFinder.getFilterFactory(null); expr = factory.property(type.getDescriptor(attributeTypeIndex).getLocalName()); }
public MaxVisitor(int attributeTypeIndex, SimpleFeatureType type) throws IllegalFilterException { FilterFactory factory = CommonFactoryFinder.getFilterFactory(null); expr = factory.property(type.getDescriptor(attributeTypeIndex).getLocalName()); }
public MaxVisitor(String attrName, SimpleFeatureType type) throws IllegalFilterException { FilterFactory factory = CommonFactoryFinder.getFilterFactory(null); expr = factory.property(type.getDescriptor(attrName).getLocalName()); }
public UniqueVisitor(String attrName, SimpleFeatureType type) throws IllegalFilterException { FilterFactory factory = CommonFactoryFinder.getFilterFactory(null); expr = factory.property(type.getDescriptor(attrName).getLocalName()); }
public MedianVisitor(String attrName, SimpleFeatureType type) throws IllegalFilterException { FilterFactory factory = CommonFactoryFinder.getFilterFactory(null); expr = factory.property(type.getDescriptor(attrName).getLocalName()); }
public MinVisitor(String attrName, SimpleFeatureType type) throws IllegalFilterException { FilterFactory factory = CommonFactoryFinder.getFilterFactory(null); expr = factory.property(type.getDescriptor(attrName).getLocalName()); }
/** * Retrieve the attributeNames defined by the featureType * * @param featureType * @return array of simple attribute names */ public static String[] attributeNames(SimpleFeatureType featureType) { String[] names = new String[featureType.getAttributeCount()]; final int count = featureType.getAttributeCount(); for (int i = 0; i < count; i++) { names[i] = featureType.getDescriptor(i).getLocalName(); } return names; }
private int searchByName(ElementValue[] value, SimpleFeatureType ft, int i, int j) { for (int k = 0; k < ft.getAttributeCount() && j == -1; k++) { // TODO use equals if ((ft.getDescriptor(k).getLocalName() == null && value[i].getElement().getName() == null) || ft.getDescriptor(k) .getLocalName() .equals(value[i].getElement().getName())) j = k; } return j; }
/** * Builds an array containing the position in the result set for each attribute. It takes into * account that rs positions start by one, about the exposed primary keys, and the fact that * exposed pk can be only partially selected in the output * * @return */ private int[] buildAttributeRsIndex() { LinkedHashSet<String> pkColumns = dataStore.getColumnNames(pkey); List<String> pkColumnsList = new ArrayList<String>(pkColumns); int[] indexes = new int[featureType.getAttributeCount()]; int exposedPks = 0; for (int i = 0; i < indexes.length; i++) { String attName = featureType.getDescriptor(i).getLocalName(); if (pkColumns.contains(attName)) { indexes[i] = pkColumnsList.indexOf(attName) + 1; exposedPks++; } else { indexes[i] = i + pkColumns.size() - exposedPks + 1; } } return indexes; }
private boolean isMatch(ElementValue[] value, SimpleFeatureType ft, int i, int k) { AttributeDescriptor AttributeDescriptor = ft.getDescriptor(k); String typeName = ft.getTypeName(); if (!AttributeDescriptor.getLocalName().equals(typeName)) return false; Class instanceClass = value[i].getValue().getClass(); if (AttributeDescriptor instanceof ChoiceAttributeType) { ChoiceAttributeType choiceAT = (ChoiceAttributeType) AttributeDescriptor; Class[] choices = choiceAT.getChoices(); for (int j = 0; j < choices.length; j++) { if (choices[j].isAssignableFrom(instanceClass)) return true; } } return AttributeDescriptor.getType().getBinding().isAssignableFrom(instanceClass); }
AttributeDescriptor attrib = target.getDescriptor(i); xpath = attrib.getLocalName(); types[i] = attrib; if (!attrib.equals(original.getDescriptor(xpath))) { throw new IllegalArgumentException( "Unable to retype FeatureReader<SimpleFeatureType, SimpleFeature> (origional does not cover "