type.getDescription()); descriptor = typeFactory.createGeometryDescriptor( geomType, elemName, minOccurs, maxOccurs, nillable, defaultValue); } else { descriptor = typeFactory.createAttributeDescriptor( type, elemName, minOccurs, maxOccurs, nillable, defaultValue);
public AttributeType getXmlAttributeType() { if (XMLATTRIBUTE_TYPE == null) { XMLATTRIBUTE_TYPE = typeFactory.createAttributeType( new NameImpl(null, "@attribute"), String.class, false, false, Collections.<Filter>emptyList(), null, null); } return XMLATTRIBUTE_TYPE; } }
if (helper.isFeatureType(typeDefinition)) { type = typeFactory.createFeatureType( assignedName, schema, boolean isIdentifiable = helper.isIdentifiable(typeDefinition); type = typeFactory.createComplexType( assignedName, schema,
AttributeDescriptor ad = factory.createAttributeDescriptor( gtType, name(element),minOccurs, maxOccurs, isNillable, null ); AttributeDescriptor ad = factory.createAttributeDescriptor( gtType, name(attribute), 0, 1, true, null); ComplexType gtType = factory.createComplexType( name(xsdType), properties, false, xsdType.isAbstract(), Collections.EMPTY_LIST, superType, null
CoordinateReferenceSystem crs = CrsTextSerializer.deserialize(crsText); attributeType = typeFactory.createGeometryType(name, type, crs, isIdentifiable, isAbstract, restrictions, superType, description); attributeDescriptor = typeFactory.createGeometryDescriptor( (GeometryType) attributeType, name, min, max, nillable, defaultValue); } else { attributeType = typeFactory.createAttributeType(name, type, isIdentifiable, isAbstract, restrictions, superType, description); attributeDescriptor = typeFactory.createAttributeDescriptor(attributeType, name, min, max, nillable, defaultValue);
public AttributeDescriptor buildDescriptor(Name name, AttributeType type) { // build the descriptor AttributeDescriptor descriptor = factory.createAttributeDescriptor( type, name, minOccurs(), maxOccurs(), isNillable, defaultValue()); // set the user data descriptor.getUserData().putAll(userData); resetDescriptorState(); return descriptor; }
.createAttributeType(attribute.getType().getName(), String.class, false, false, null, null, null); AttributeDescriptor descriptor = builder.getFeatureTypeFactory() .createAttributeDescriptor(type, type.getName(), 0, 1, true, null);
private static AttributeType readAttributeType(DataInput in, FeatureTypeFactory typeFactory) throws IOException { final Name name = readName(in); final byte typeTag = in.readByte(); final FieldType type = FieldType.valueOf(typeTag); if (Geometry.class.isAssignableFrom(type.getBinding())) { final boolean isCRSCode = in.readBoolean(); // as opposed to a raw WKT string final String crsText = in.readUTF(); final CoordinateReferenceSystem crs; try { if (isCRSCode) { if (RevObjects.NULL_CRS_IDENTIFIER.equals(crsText)) { crs = null; } else { boolean forceLongitudeFirst = crsText.startsWith("EPSG:"); crs = CRS.decode(crsText, forceLongitudeFirst); } } else { crs = CRS.parseWKT(crsText); } } catch (FactoryException e) { throw new RuntimeException(e); } return typeFactory.createGeometryType(name, type.getBinding(), crs, false, false, Collections.<Filter> emptyList(), null, null); } else { return typeFactory.createAttributeType(name, type.getBinding(), false, false, Collections.<Filter> emptyList(), null, null); } }
private GeometryDescriptor reprojectGeometry(GeometryDescriptor descr) { if (descr == null) { return null; } GeometryType type = ftf.createGeometryType( descr.getType().getName(), descr.getType().getBinding(), reprojection, descr.getType().isIdentified(), descr.getType().isAbstract(), descr.getType().getRestrictions(), descr.getType().getSuper(), descr.getType().getDescription()); type.getUserData().putAll(descr.getType().getUserData()); GeometryDescriptor gd = ftf.createGeometryDescriptor( type, descr.getName(), descr.getMinOccurs(), descr.getMaxOccurs(), descr.isNillable(), descr.getDefaultValue()); gd.getUserData().putAll(descr.getUserData()); return gd; }
private FeatureType reprojectType(FeatureType type) { Collection<PropertyDescriptor> schema = new ArrayList<PropertyDescriptor>(); for (PropertyDescriptor descr : type.getDescriptors()) { if (descr instanceof GeometryDescriptor) { schema.add(reprojectGeometry((GeometryDescriptor) descr)); } else { schema.add(descr); } } FeatureType ft; if (type instanceof NonFeatureTypeProxy) { ft = new NonFeatureTypeProxy( ((NonFeatureTypeProxy) type).getSubject(), mapping, schema); } else { ft = ftf.createFeatureType( type.getName(), schema, reprojectGeometry(type.getGeometryDescriptor()), type.isAbstract(), type.getRestrictions(), type.getSuper(), type.getDescription()); } ft.getUserData().putAll(type.getUserData()); return ft; }
/** * Builds the geometry attribute type. * * <p>This method resets all state after the attribute is built. */ public GeometryType buildGeometryType() { GeometryType type = factory.createGeometryType( name(), binding, crs, isIdentifiable, isAbstract, restrictions(), superType, description()); resetTypeState(); return type; }
public GeometryDescriptor buildDescriptor(Name name, GeometryType type) { GeometryDescriptor descriptor = factory.createGeometryDescriptor( type, name, minOccurs(), maxOccurs(), isNillable, defaultValue()); // set the user data descriptor.getUserData().putAll(userData); resetDescriptorState(); return descriptor; }
public TypeBuilder association(Name name, AssociationType type) { AssociationDescriptor descriptor = getTypeFactory() .createAssociationDescriptor( type, name, getMinOccurs(), getMaxOccurs(), isNillable()); add(descriptor); return this; }
AssociationType associationType = tf.createAssociationType(type .getName(), associatedType, false, Collections.EMPTY_LIST, null, null); AssociationDescriptor associationDescriptor = tf .createAssociationDescriptor(associationType, type.getName(), 1, 1, true);
ComplexType type = getTypeFactory() .createComplexType( typeName(), properties(),
/** Create AssociationType */ public AssociationType association() { return factory.createAssociationType( typeName(), getReferenceType(), true, this.restrictions, getAssociationSuper(), this.getDescription()); }
CoordinateReferenceSystem crs = CrsTextSerializer.deserialize(crsText); attributeType = typeFactory.createGeometryType(name, type, crs, isIdentifiable, isAbstract, restrictions, superType, description); attributeDescriptor = typeFactory.createGeometryDescriptor( (GeometryType) attributeType, name, min, max, nillable, defaultValue); } else { attributeType = typeFactory.createAttributeType(name, type, isIdentifiable, isAbstract, restrictions, superType, description); attributeDescriptor = typeFactory.createAttributeDescriptor(attributeType, name, min, max, nillable, defaultValue);
public void addAttribute(Name name, AttributeType type) { // TODO: handle default value AttributeDescriptor descriptor = getTypeFactory() .createAttributeDescriptor( type, name, getMinOccurs(), getMaxOccurs(), isNillable(), null); add(descriptor); }
AttributeType superType = null; InternationalString description = null; AttributeType attribute1 = ftf.createAttributeType(attName1, binding, isIdentifiable, isAbstract, restrictions, superType, description); AttributeType attribute2 = ftf.createAttributeType(attName2, binding, isIdentifiable, isAbstract, restrictions, superType, description); boolean isNillable = true; Object defaultValue = null; AttributeDescriptor descriptor1 = ftf.createAttributeDescriptor(attribute1, attribute1.getName(), minOccurs, maxOccurs, isNillable, defaultValue); minOccurs = 0; maxOccurs = 10; AttributeDescriptor descriptor2 = ftf.createAttributeDescriptor(attribute2, attribute2.getName(), minOccurs, maxOccurs, isNillable, defaultValue);
private static AttributeType readAttributeType(DataInput in, FeatureTypeFactory typeFactory) throws IOException { final Name name = readName(in); final byte typeTag = in.readByte(); final FieldType type = FieldType.valueOf(typeTag); if (Geometry.class.isAssignableFrom(type.getBinding())) { final boolean isCRSCode = in.readBoolean(); // as opposed to a raw WKT string final String crsText = in.readUTF(); final CoordinateReferenceSystem crs; try { if (isCRSCode) { if (RevObjects.NULL_CRS_IDENTIFIER.equals(crsText)) { crs = null; } else { boolean forceLongitudeFirst = crsText.startsWith("EPSG:"); crs = CRS.decode(crsText, forceLongitudeFirst); } } else { crs = CRS.parseWKT(crsText); } } catch (FactoryException e) { throw new RuntimeException(e); } return typeFactory.createGeometryType(name, type.getBinding(), crs, false, false, Collections.<Filter> emptyList(), null, null); } else { return typeFactory.createAttributeType(name, type.getBinding(), false, false, Collections.<Filter> emptyList(), null, null); } }