public InternationalString getDescription() { return getSubject().getDescription(); }
/** Initializes builder state from another attribute type. */ public AttributeTypeBuilder init(AttributeType type) { name = type.getName().getLocalPart(); separator = type.getName().getSeparator(); namespaceURI = type.getName().getNamespaceURI(); isAbstract = type.isAbstract(); if (type.getRestrictions() != null) { restrictions().addAll(type.getRestrictions()); } description = type.getDescription() != null ? type.getDescription().toString() : null; isIdentifiable = type.isIdentified(); binding = type.getBinding(); superType = type.getSuper(); if (type instanceof GeometryType) { crs = ((GeometryType) type).getCoordinateReferenceSystem(); } return this; }
type.getRestrictions(), type.getSuper(), type.getDescription()); descriptor = typeFactory.createGeometryDescriptor(
targetNodeType.getRestrictions(), targetNodeType.getSuper(), targetNodeType.getDescription());
public InternationalString getDescription() { return getSubject().getDescription(); }
public InternationalString getDescription() { return getSubject().getDescription(); }
void assertEqualsLax(SimpleFeatureType e, SimpleFeatureType a) { if (e.equals(a)) { return; } // do a lax check assertEquals(e.getAttributeCount(), a.getAttributeCount()); for (int i = 0; i < e.getAttributeCount(); i++) { AttributeDescriptor att1 = e.getDescriptor(i); AttributeDescriptor att2 = a.getDescriptor(i); assertEquals(att1.getName(), att2.getName()); assertEquals(att1.getMinOccurs(), att2.getMinOccurs()); assertEquals(att1.getMaxOccurs(), att2.getMaxOccurs()); assertEquals(att1.isNillable(), att2.isNillable()); assertEquals(att1.getDefaultValue(), att2.getDefaultValue()); AttributeType t1 = att1.getType(); AttributeType t2 = att2.getType(); assertEquals(t1.getName(), t2.getName()); assertEquals(t1.getDescription(), t2.getDescription()); assertEquals(t1.getRestrictions(), t2.getRestrictions()); // be a bit lax on type mappings if (!t1.getBinding().equals(t2.getBinding())) { if (Number.class.isAssignableFrom(t1.getBinding())) { assertTrue(Number.class.isAssignableFrom(t2.getBinding())); } if (Date.class.isAssignableFrom(t2.getBinding())) { assertTrue(Date.class.isAssignableFrom(t2.getBinding())); } } } }
@Override public List<Attribute> getFixedValueAttributes(String datasourceId) { Iterator<AttributeType> typeIterator; try { typeIterator = getAttributesForDatasource(new Datasource(datasourceSpec)).iterator(); } catch (IOException ioe) { log.error("Could not get the list of fixed value attributes for {}, {}", datasourceId, ioe.getMessage()); return Collections.emptyList(); } List<Attribute> fixedValueAttributes = new ArrayList<>(); while (typeIterator.hasNext()) { AttributeType type = typeIterator.next(); String columnName = type.getName().toString(); if (NON_ATTRIBUTE_COLUMNS.contains(columnName)) { continue; } fixedValueAttributes.add(new Attribute( getProvider(), columnName, null != type.getDescription() ? type.getDescription().toString() : columnName) ); } return fixedValueAttributes; }
/** * Initializes builder state from another attribute type. */ public AttributeTypeBuilder init( AttributeType type ) { name = type.getName().getLocalPart(); separator = type.getName().getSeparator(); namespaceURI = type.getName().getNamespaceURI(); isAbstract = type.isAbstract(); if ( type.getRestrictions() != null ) { restrictions().addAll( type.getRestrictions() ); } description = type.getDescription() != null ? type.getDescription().toString() : null; isIdentifiable = type.isIdentified(); binding = type.getBinding(); superType = type.getSuper(); if ( type instanceof GeometryType ) { crs = ((GeometryType)type).getCoordinateReferenceSystem(); } return this; }
private AttributeDescriptor createAttributeDescriptor(AttributeType type, CoordinateReferenceSystem crs, Name elemName, int minOccurs, int maxOccurs, boolean nillable, Object defaultValue) { AttributeDescriptor descriptor = null; if (maxOccurs == -1) { // this happens when maxOccurs is set to "unbounded" maxOccurs = Integer.MAX_VALUE; } if (!(type instanceof AttributeTypeProxy) && Geometry.class.isAssignableFrom(type.getBinding())) { // create geometry descriptor with the simple feature type CRS GeometryType geomType = new GeometryTypeImpl(type.getName(), type.getBinding(), crs, type.isIdentified(), type.isAbstract(), type.getRestrictions(), type.getSuper(), type.getDescription()); descriptor = typeFactory.createGeometryDescriptor(geomType, elemName, minOccurs, maxOccurs, nillable, defaultValue); } else { descriptor = typeFactory.createAttributeDescriptor(type, elemName, minOccurs, maxOccurs, nillable, defaultValue); } return descriptor; }
type.getRestrictions(), type.getSuper(), type.getDescription()); descriptor = typeFactory.createGeometryDescriptor(
.isAbstract(), targetNodeType.getRestrictions(), targetNodeType .getSuper(), targetNodeType.getDescription());