use of org.opengis.feature.Attribute in project geotoolkit by Geomatys.
the class JAXPStreamFeatureWriter method writeCharacteristics.
private void writeCharacteristics(Attribute att) throws XMLStreamException {
final Iterator<Attribute> ite = att.characteristics().values().iterator();
while (ite.hasNext()) {
final Attribute chara = ite.next();
final GenericName name = chara.getName();
final String namespace = getNamespace(name);
String localPart = name.tip().toString();
if (localPart.startsWith("@")) {
// remove the @
localPart = localPart.substring(1);
}
Object value = chara.getValue();
if (value instanceof Boolean) {
value = (Boolean) value ? "1" : "0";
}
if (value != null) {
writer.writeAttribute(namespace, localPart, ObjectConverters.convert(value, String.class));
}
}
}
Aggregations