PropertyDescriptor pd = ft.getDescriptor(attName); if (pd == null || !(pd instanceof AttributeDescriptor)) { throw new IOException(
/** * Returns if a property can contain null values, or not. If we don't have the schema * information, or we don't know the property, we are going to assume the property is nillable * to stay on the safe side */ private boolean isNillable(String name) { if (schema == null) { return true; } PropertyDescriptor descriptor = schema.getDescriptor(name); return descriptor == null || descriptor.isNillable(); } }
PropertyDescriptor actualDescriptor = actual.getDescriptor(expectedName);
PropertyDescriptor propertyDescriptor = featureType.getDescriptor(name);
(AttributeDescriptor) fType.getDescriptor(COMPLEX_ATTRIBUTE); ComplexType complexAttType = (ComplexType) complexDesc.getType(); AttributeDescriptor rootDesc = (AttributeDescriptor) fType.getDescriptor(SIMPLE_ATTRIBUTE); AttributeImpl simpleAttribute = new AttributeImpl("simple value", simpleAttributeDesc, null);
nextAttribute.value, (AttributeDescriptor) this.targetType.getDescriptor(nextAttribute.name), null)); } else {
public PropertyDescriptor getDescriptor(String name) { return delegate.getDescriptor(name); }
public PropertyDescriptor getDescriptor(Name name) { return delegate.getDescriptor(name); }
|| featureCollection.getSchema().getDescriptor(fromMeasureAttb) == null) { throw new ProcessException( "The from_measure_attb parameter was not provided or not defined in schema"); || featureCollection.getSchema().getDescriptor(toMeasureAttb) == null) { throw new ProcessException("The to_measure_attb parameter was not provided");
throw new ProcessException(Errors.format(ErrorKeys.NULL_ARGUMENT_$1, "attribute")); PropertyDescriptor property = features.getSchema().getDescriptor(attribute); if (property == null) { throw new ProcessException("No such feature attribute '" + attribute + "'");
|| featureCollection.getSchema().getDescriptor(fromMeasureAttb) == null) { throw new ProcessException( "The from_measure_attb parameter was not provided or not defined in schema"); || featureCollection.getSchema().getDescriptor(toMeasureAttb) == null) { throw new ProcessException("The to_measure_attb parameter was not provided");
private static void addDifference(String s, Map<PropertyDescriptor, AttributeDiff> map, RevFeatureType oldRevFeatureType, RevFeatureType newRevFeatureType) { String[] tokens = s.split("\t"); PropertyDescriptor descriptor = oldRevFeatureType.type().getDescriptor(tokens[0]); if (descriptor == null) { descriptor = newRevFeatureType.type().getDescriptor(tokens[0]); } AttributeDiff ad = AttributeDiffFactory.attributeDiffFromText( descriptor.getType().getBinding(), s.substring(s.indexOf("\t") + 1)); map.put(descriptor, ad); }
private static void addDifference(String s, Map<PropertyDescriptor, AttributeDiff> map, RevFeatureType oldRevFeatureType, RevFeatureType newRevFeatureType) { String[] tokens = s.split("\t"); PropertyDescriptor descriptor = oldRevFeatureType.type().getDescriptor(tokens[0]); if (descriptor == null) { descriptor = newRevFeatureType.type().getDescriptor(tokens[0]); } AttributeDiff ad = AttributeDiffFactory.attributeDiffFromText(descriptor.getType() .getBinding(), s.substring(s.indexOf("\t") + 1)); map.put(descriptor, ad); }
private static void addDifference(String s, Map<PropertyDescriptor, AttributeDiff> map, RevFeatureType oldRevFeatureType, RevFeatureType newRevFeatureType) { String[] tokens = s.split("\t"); PropertyDescriptor descriptor = oldRevFeatureType.type().getDescriptor(tokens[0]); if (descriptor == null) { descriptor = newRevFeatureType.type().getDescriptor(tokens[0]); } AttributeDiff ad = AttributeDiffFactory.attributeDiffFromText( descriptor.getType().getBinding(), s.substring(s.indexOf("\t") + 1)); map.put(descriptor, ad); }
|| featureCollection.getSchema().getDescriptor(fromMeasureAttb) == null) { throw new ProcessException( "The from_measure_attb parameter was not provided or not defined in schema"); || featureCollection.getSchema().getDescriptor(toMeasureAttb) == null) { throw new ProcessException("The to_measure_attb parameter was not provided");
protected List<PropertyName> addGeometryProperties( FeatureTypeInfo meta, List<PropertyName> oldProperties) throws IOException { List<AttributeTypeInfo> atts = meta.attributes(); Iterator ii = atts.iterator(); List<PropertyName> properties = new ArrayList<PropertyName>(oldProperties); while (ii.hasNext()) { AttributeTypeInfo ati = (AttributeTypeInfo) ii.next(); PropertyName propName = filterFactory.property(ati.getName()); if (meta.getFeatureType().getDescriptor(ati.getName()) instanceof GeometryDescriptor && !properties.contains(propName)) { properties.add(propName); } } return properties; } }
@Override protected String checkAttribute(FeatureTypeInfo cfg){ String attribute = MapLayerInfo.getRegionateAttribute(cfg); try{ FeatureType ft = cfg.getFeatureType(); if ((attribute != null) && (ft.getDescriptor(attribute) != null)) return attribute; return ft.getGeometryDescriptor().getLocalName(); } catch (Exception e) { LOGGER.severe("Couldn't get attribute name due to " + e); return null; } }
private void setAttribute(Feature sf, String name, Object value) { Property p = sf.getProperty(name); if (p != null) { p.setValue(value); } else { List<Property> properties = new ArrayList<>(sf.getValue()); AttributeDescriptor ad = (AttributeDescriptor) sf.getType().getDescriptor(name); properties.add(new AttributeImpl(value, ad, null)); } }
private void assertPropertyNamespace(FeatureType schema, String name, String namespaceURI) { PropertyDescriptor wl = schema.getDescriptor(name); assertNotNull(wl); assertEquals(namespaceURI, wl.getName().getNamespaceURI()); }
@Override protected void mapPropertiesToComplex(ComplexFeatureBuilder builder, SimpleFeature fi) { // basic mappings super.mapPropertiesToComplex(builder, fi); // quicklook extraction Object metadataValue = fi.getAttribute("quicklook"); if (metadataValue instanceof SimpleFeature) { SimpleFeature quicklookFeature = (SimpleFeature) metadataValue; AttributeBuilder ab = new AttributeBuilder(CommonFactoryFinder.getFeatureFactory(null)); ab.setDescriptor( (AttributeDescriptor) schema.getDescriptor(OpenSearchAccess.QUICKLOOK_PROPERTY_NAME)); Attribute attribute = ab.buildSimple(null, quicklookFeature.getAttribute("thumb")); builder.append(OpenSearchAccess.QUICKLOOK_PROPERTY_NAME, attribute); } }