kind = "association";
}
else {
kind = "property";
}
JSONObj property = attributes.addObject()
.put("name", NAME )
.put("property", kind )
.put("type", t.getBinding().getSimpleName() );
if( d instanceof GeometryDescriptor){
GeometryDescriptor g = (GeometryDescriptor) d;
proj( property.putObject("proj"), g.getCoordinateReferenceSystem(), null );
}
if( details){
property
.put("namespace", d.getName().getNamespaceURI() )
.put("description", t.getDescription() )
.put("min-occurs",d.getMinOccurs() )
.put("max-occurs",d.getMaxOccurs() )
.put("nillable",d.isNillable());
int length = FeatureTypes.getFieldLength(d);
if( length != FeatureTypes.ANY_LENGTH ){
property.put("length", length );
}
if( d instanceof AttributeDescriptor){
AttributeDescriptor a = (AttributeDescriptor) d;
property.put("default-value", a.getDefaultValue() );
}
if( !t.getRestrictions().isEmpty() ){
JSONArr validate = property.putArray("validate");
for( Filter f : t.getRestrictions() ){
String cql;
try {
Filter clean = (Filter) f.accept( new DuplicatingFilterVisitor(){
public PropertyName visit(PropertyName e, Object extraData ){