/** * Sets the maxOccurs of the next attribute added to the feature type. * * <p>This value is reset after a call to {@link #add(String, Class)} */ public SimpleFeatureTypeBuilder maxOccurs(int maxOccurs) { attributeBuilder.setMaxOccurs(maxOccurs); return this; } /**
public AttributeTypeBuilder maxOccurs(int maxOccurs) { setMaxOccurs(maxOccurs); return this; }
/** * Sets the maxOccurs of the next attribute added to the feature type. * <p> * This value is reset after a call to {@link #add(String, Class)} * </p> */ public SimpleFeatureTypeBuilder maxOccurs( int maxOccurs ) { attributeBuilder.setMaxOccurs(maxOccurs); return this; } /**
public AttributeTypeBuilder maxOccurs(int maxOccurs) { setMaxOccurs(maxOccurs); return this; }
builder.setBinding(descriptor.getType().getBinding()); builder.setMinOccurs(descriptor.getMinOccurs()); builder.setMaxOccurs(descriptor.getMaxOccurs()); builder.setDefaultValue(descriptor.getDefaultValue()); builder.setCRS(schema.getCoordinateReferenceSystem());
@Override protected void connect() throws Exception { super.connect(); // we need to use the type builder because the pk has min occurs = 1 on Oracle AttributeTypeBuilder atb = new AttributeTypeBuilder(); atb.setMinOccurs(isPkNillable() ? 0 : 1); atb.setMaxOccurs(1); atb.setNillable(isPkNillable()); atb.setName(FID); atb.setBinding(Integer.class); AttributeDescriptor fidDescriptor = atb.buildDescriptor(FID); SimpleFeatureTypeBuilder tb = new SimpleFeatureTypeBuilder(); tb.setNamespaceURI(dataStore.getNamespaceURI()); tb.setName(LAKESVIEW); tb.add(fidDescriptor); tb.add(ID, Integer.class); tb.add(GEOM, Polygon.class, (CoordinateReferenceSystem) null); tb.add(NAME, String.class); lakeViewSchema = tb.buildFeatureType(); lakeViewPkSchema = tb.retype(lakeViewSchema, new String[] {ID, GEOM, NAME}); }
atb.setBinding(String.class); atb.setMinOccurs(nillable ? 0 : 1); atb.setMaxOccurs(1); return atb.buildDescriptor(columnName); } else {
builder.setBinding(String.class); builder.setMinOccurs(descriptor.getMinOccurs()); builder.setMaxOccurs(descriptor.getMaxOccurs()); builder.setDefaultValue(descriptor.getDefaultValue()); builder.setCRS(
private AttributeDescriptor buildFeatureDescriptor( Name name, SimpleFeatureType schema, int minOccurs, int maxOccurs) { AttributeTypeBuilder ab = new AttributeTypeBuilder(); ab.name(name.getLocalPart()).namespaceURI(name.getNamespaceURI()); ab.setMinOccurs(minOccurs); ab.setMaxOccurs(maxOccurs); AttributeDescriptor descriptor = ab.buildDescriptor(name, schema); return descriptor; }
private void collectAttributes(SimpleFeatureType schema, List<String> retainedAttributes, SimpleFeatureTypeBuilder tb) { for (AttributeDescriptor descriptor : schema.getAttributeDescriptors()) { // check whether descriptor has been selected in the attribute list boolean isInRetainList = true; if (retainedAttributes != null) { isInRetainList = retainedAttributes.contains(descriptor.getLocalName()); logger.fine("Checking "+descriptor.getLocalName()+" --> "+isInRetainList); } if (!isInRetainList || schema.getGeometryDescriptor() == descriptor) { continue; } // build the attribute to return AttributeTypeBuilder builder = new AttributeTypeBuilder(); builder.setName(schema.getName().getLocalPart() + "_" + descriptor.getName()); builder.setNillable(descriptor.isNillable()); builder.setBinding(descriptor.getType().getBinding()); builder.setMinOccurs(descriptor.getMinOccurs()); builder.setMaxOccurs(descriptor.getMaxOccurs()); builder.setDefaultValue(descriptor.getDefaultValue()); builder.setCRS(schema.getCoordinateReferenceSystem()); AttributeDescriptor intersectionDescriptor = builder.buildDescriptor(schema .getName().getLocalPart() + "_" + descriptor.getName(), descriptor.getType()); tb.add(intersectionDescriptor); tb.addBinding(descriptor.getType()); } }
builder.setBinding(String.class); // to string builder.setMinOccurs(descriptor.getMinOccurs()); builder.setMaxOccurs(descriptor.getMaxOccurs()); builder.setDefaultValue(descriptor.getDefaultValue()); builder.setCRS(delegate.getSchema().getCoordinateReferenceSystem());
builder.setBinding(String.class); builder.setMinOccurs(descriptor.getMinOccurs()); builder.setMaxOccurs(descriptor.getMaxOccurs()); builder.setDefaultValue(descriptor.getDefaultValue()); builder.setCRS(this.delegate.features().next().getFeatureType()