/** * Create an instance of {@link Schema} * */ public static Schema createSchema() { return new Schema(); }
/** * fluent setter * @see #setId(String) * * @param id * required parameter */ public Schema withId(final String id) { this.setId(id); return this; }
/** * fluent setter * @see #setName(String) * * @param name * required parameter */ public Schema withName(final String name) { this.setName(name); return this; }
private void addSchema(Document doc, String id, SimpleFeatureType featureType) { Schema schema = doc.createAndAddSchema(); schema.setId(id); schema.setName(id); for (AttributeDescriptor ad : featureType.getAttributeDescriptors()) { // skip geometry attributes if (ad instanceof GeometryDescriptor) { continue; } SimpleField field = schema.createAndAddSimpleField(); field.setName(ad.getLocalName()); field.setType(getKmlFieldType(ad)); } }
Schema schema = new Schema().withId("schema1") .withSimpleField(Arrays.asList( new SimpleField().withName("index").withType("uint"), new SimpleField().withName("coord").withType("string"),
@Override public Schema clone() { Schema copy; try { copy = ((Schema) super.clone()); } catch (CloneNotSupportedException _x) { throw new InternalError((_x.toString())); } copy.simpleField = new ArrayList<SimpleField>((getSimpleField().size())); for (SimpleField iter: simpleField) { copy.simpleField.add(iter.clone()); } copy.schemaExtension = new ArrayList<Object>((getSchemaExtension().size())); for (Object iter: schemaExtension) { copy.schemaExtension.add(iter); } return copy; }
/** * add a value to the simpleField property collection * * @param simpleField * Objects of the following type are allowed in the list: {@link SimpleField} * @return * <tt>true</tt> (as general contract of <tt>Collection.add</tt>). */ public Schema addToSimpleField(final SimpleField simpleField) { this.getSimpleField().add(simpleField); return this; }
/** * fluent setter * @see #setSchemaExtension(List<Object>) * * @param schemaExtension * required parameter */ public Schema withSchemaExtension(final List<Object> schemaExtension) { this.setSchemaExtension(schemaExtension); return this; }
/** * fluent setter * @see #setSimpleField(List<SimpleField>) * * @param simpleField * required parameter */ public Schema withSimpleField(final List<SimpleField> simpleField) { this.setSimpleField(simpleField); return this; }
/** * add a value to the schemaExtension property collection * * @param schemaExtension * Objects of the following type are allowed in the list: {@code <}{@link SimpleArrayField}{@code>}{@link JAXBElement}{@code <}{@link Object}{@code>} * @return * <tt>true</tt> (as general contract of <tt>Collection.add</tt>). */ public Schema addToSchemaExtension(final Object schemaExtension) { this.getSchemaExtension().add(schemaExtension); return this; }
@Override public Document clone() { Document copy; copy = ((Document) super.clone()); copy.schema = new ArrayList<Schema>((getSchema().size())); for (Schema iter: schema) { copy.schema.add(iter.clone()); } copy.feature = new ArrayList<Feature>((getFeature().size())); for (Feature iter: feature) { copy.feature.add(iter.clone()); } copy.documentSimpleExtension = new ArrayList<Object>((getDocumentSimpleExtension().size())); for (Object iter: documentSimpleExtension) { copy.documentSimpleExtension.add(iter); } copy.documentObjectExtension = new ArrayList<AbstractObject>((getDocumentObjectExtension().size())); for (AbstractObject iter: documentObjectExtension) { copy.documentObjectExtension.add(iter.clone()); } return copy; }
@Override public Schema clone() { Schema copy; try { copy = ((Schema) super.clone()); } catch (CloneNotSupportedException _x) { throw new InternalError((_x.toString())); } copy.simpleField = new ArrayList<SimpleField>((getSimpleField().size())); for (SimpleField iter: simpleField) { copy.simpleField.add(iter.clone()); } copy.schemaExtension = new ArrayList<Object>((getSchemaExtension().size())); for (Object iter: schemaExtension) { copy.schemaExtension.add(iter); } return copy; }
/** * add a value to the simpleField property collection * * @param simpleField * Objects of the following type are allowed in the list: {@link SimpleField} * @return * <tt>true</tt> (as general contract of <tt>Collection.add</tt>). */ public Schema addToSimpleField(final SimpleField simpleField) { this.getSimpleField().add(simpleField); return this; }
/** * fluent setter * @see #setSchemaExtension(List<Object>) * * @param schemaExtension * required parameter */ public Schema withSchemaExtension(final List<Object> schemaExtension) { this.setSchemaExtension(schemaExtension); return this; }
/** * fluent setter * @see #setSimpleField(List<SimpleField>) * * @param simpleField * required parameter */ public Schema withSimpleField(final List<SimpleField> simpleField) { this.setSimpleField(simpleField); return this; }
/** * add a value to the schemaExtension property collection * * @param schemaExtension * Objects of the following type are allowed in the list: {@code <}{@link SimpleArrayField}{@code>}{@link JAXBElement}{@code <}{@link Object}{@code>} * @return * <tt>true</tt> (as general contract of <tt>Collection.add</tt>). */ public Schema addToSchemaExtension(final Object schemaExtension) { this.getSchemaExtension().add(schemaExtension); return this; }
@Override public Document clone() { Document copy; copy = ((Document) super.clone()); copy.schema = new ArrayList<Schema>((getSchema().size())); for (Schema iter: schema) { copy.schema.add(iter.clone()); } copy.feature = new ArrayList<Feature>((getFeature().size())); for (Feature iter: feature) { copy.feature.add(iter.clone()); } copy.documentSimpleExtension = new ArrayList<Object>((getDocumentSimpleExtension().size())); for (Object iter: documentSimpleExtension) { copy.documentSimpleExtension.add(iter); } copy.documentObjectExtension = new ArrayList<AbstractObject>((getDocumentObjectExtension().size())); for (AbstractObject iter: documentObjectExtension) { copy.documentObjectExtension.add(iter.clone()); } return copy; }
/** * Create an instance of {@link Schema} * */ public static Schema createSchema() { return new Schema(); }
/** * fluent setter * @see #setId(String) * * @param id * required parameter */ public Schema withId(final String id) { this.setId(id); return this; }
/** * fluent setter * @see #setName(String) * * @param name * required parameter */ public Schema withName(final String name) { this.setName(name); return this; }