From: <aa...@sv...> - 2007-09-30 21:56:13
|
Author: aaime Date: 2007-09-30 14:53:59 -0700 (Sun, 30 Sep 2007) New Revision: 27275 Modified: geotools/trunk/gt/modules/library/main/src/main/java/org/geotools/feature/simple/SimpleFeatureTypeBuilder.java Log: Added a way to set attributes Modified: geotools/trunk/gt/modules/library/main/src/main/java/org/geotools/feature/simple/SimpleFeatureTypeBuilder.java =================================================================== --- geotools/trunk/gt/modules/library/main/src/main/java/org/geotools/feature/simple/SimpleFeatureTypeBuilder.java 2007-09-30 21:43:14 UTC (rev 27274) +++ geotools/trunk/gt/modules/library/main/src/main/java/org/geotools/feature/simple/SimpleFeatureTypeBuilder.java 2007-09-30 21:53:59 UTC (rev 27275) @@ -2,6 +2,7 @@ import java.net.URI; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -706,10 +707,21 @@ List atts = attributes(); atts.clear(); if(attributes != null) - atts.addAll(attributes); + atts.addAll(attributes); } + /** + * Directly sets the list of attributes. + * @param attributes the new list of attributes, or null to reset the list + */ + public void setAttributes(AttributeDescriptor[] attributes) { + List atts = attributes(); + atts.clear(); + if(attributes != null) + atts.addAll(Arrays.asList(attributes)); + } + /** * Builds a feature type from compiled state. * <p> |