SimpleFeatureType schema = layer.getSchema();
SummaryData schemaData=new SummaryData(Messages.LayerSummary_featureType, schema.getName().getLocalPart());
SummaryData[] children=new SummaryData[schema.getAttributeCount()];
for( int i = 0; i < children.length; i++ ) {
AttributeDescriptor attributeType = schema.getDescriptor(i);
children[i]=new SummaryData(attributeType.getLocalName(), attributeType.getType().getBinding().getSimpleName());
children[i].setParent(schemaData);
List<SummaryData> attTypeChildren=new ArrayList<SummaryData>();
attTypeChildren.add(new SummaryData(Messages.LayerSummary_nillable, attributeType.isNillable()));
attTypeChildren.get(0).setParent(children[i]);
List<Filter> restrictions = attributeType.getType().getRestrictions();
for (Filter filter : restrictions) {
SummaryData summaryData = new SummaryData(Messages.LayerSummary_restriction, filter);
attTypeChildren.add(summaryData);
summaryData.setParent(children[i]);
}
SummaryData summaryData = new SummaryData(Messages.LayerSummary_maxOccurs, attributeType.getMaxOccurs());
attTypeChildren.add(summaryData);
summaryData.setParent(children[i]);
summaryData = new SummaryData(Messages.LayerSummary_minOccurs, attributeType.getMinOccurs());
attTypeChildren.add(summaryData);
summaryData.setParent(children[i]);
children[i].setChildren(attTypeChildren.toArray(new SummaryData[0]));
}