@Test public void testGetAncestors() { SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder(); builder.setName("SomeFeature"); builder.setCRS(null); builder.add("name", String.class); builder.add("geom", Point.class); SimpleFeatureType ft = builder.buildFeatureType(); List<FeatureType> types = FeatureTypes.getAncestors(ft); Assert.assertEquals(1, types.size()); Assert.assertEquals("Feature", types.get(0).getName().getLocalPart()); }
public static List<FeatureType> getAncestors(FeatureType featureType) { List<FeatureType> ancestors = new ArrayList<FeatureType>(); while (featureType.getSuper() instanceof FeatureType) { FeatureType superType = (FeatureType) featureType.getSuper(); ancestors.add(superType); featureType = superType; } return ancestors; }
FeatureTypes { public static List<FeatureType> getAncestors(FeatureType featureType) { List<FeatureType> ancestors = new ArrayList<FeatureType>(); while (featureType.getSuper() instanceof FeatureType) { FeatureType superType = (FeatureType) featureType.getSuper(); ancestors.add(superType); featureType = superType; } return ancestors; } }
FeatureTypes { public static List<FeatureType> getAncestors(FeatureType featureType) { List<FeatureType> ancestors = new ArrayList<FeatureType>(); while (featureType.getSuper() instanceof FeatureType) { FeatureType superType = (FeatureType) featureType.getSuper(); ancestors.add(superType); featureType = superType; } return ancestors; }  }
FeatureTypes { public static List<FeatureType> getAncestors(FeatureType featureType) { List<FeatureType> ancestors = new ArrayList<FeatureType>(); while (featureType.getSuper() instanceof FeatureType) { FeatureType superType = (FeatureType) featureType.getSuper(); ancestors.add(superType); featureType = superType; } return ancestors; }  static int getFieldLength( PropertyDescriptor descriptor ); static SimpleFeatureType transform( SimpleFeatureType schema, CoordinateReferenceSystem crs ); static SimpleFeatureType transform( SimpleFeatureType schema, CoordinateReferenceSystem crs, boolean forceOnlyMissing); static SimpleFeature transform( SimpleFeature feature, SimpleFeatureType schema, MathTransform transform ); static SimpleFeatureType newFeatureType( AttributeDescriptor[] types, String name, URI ns,
            boolean isAbstract, SimpleFeatureType[] superTypes ); static SimpleFeatureType newFeatureType( AttributeDescriptor[] types, String name, URI ns,
            boolean isAbstract, SimpleFeatureType[] superTypes, AttributeDescriptor defaultGeometry ); static SimpleFeatureType newFeatureType( AttributeDescriptor[] types, String name, URI ns,
            boolean isAbstract, SimpleFeatureType[] superTypes, GeometryDescriptor   defaultGeometry ); static SimpleFeatureType newFeatureType( AttributeDescriptor[] types, String name, URI ns,
            boolean isAbstract ); static SimpleFeatureType newFeatureType( AttributeDescriptor[] types, String name, URI ns ); static SimpleFeatureType newFeatureType( AttributeDescriptor[] types, String name ); static List<FeatureType> getAncestors(FeatureType featureType); static boolean isDecendedFrom(FeatureType featureType, URI namespace, String typeName); static boolean isDecendedFrom(FeatureType featureType, FeatureType isParentType); static boolean equals( SimpleFeatureType typeA, SimpleFeatureType typeB ); static boolean equalsExact( SimpleFeatureType typeA, SimpleFeatureType typeB ); static boolean equals( List attributesA, List attributesB); static boolean equalsExact( List attributesA, List attributesB); static boolean equals( AttributeDescriptor attributesA[], AttributeDescriptor attributesB[] ); static boolean equalsExact( AttributeDescriptor attributesA[], AttributeDescriptor attributesB[] ); static boolean equalsAncestors( SimpleFeatureType typeA, SimpleFeatureType typeB ); static Set ancestors( SimpleFeatureType featureType ); static boolean equals( AttributeDescriptor a, AttributeDescriptor b); static boolean equalsExact( AttributeDescriptor a, AttributeDescriptor b); static boolean equalsId( SimpleFeatureType typeA, SimpleFeatureType typeB ); }
FeatureTypes { public static List<FeatureType> getAncestors(FeatureType featureType) { List<FeatureType> ancestors = new ArrayList<FeatureType>(); while (featureType.getSuper() instanceof FeatureType) { FeatureType superType = (FeatureType) featureType.getSuper(); ancestors.add(superType); featureType = superType; } return ancestors; }  static int getFieldLength( PropertyDescriptor descriptor ); static SimpleFeatureType transform( SimpleFeatureType schema, CoordinateReferenceSystem crs ); static SimpleFeatureType transform( SimpleFeatureType schema, CoordinateReferenceSystem crs, boolean forceOnlyMissing); static SimpleFeature transform( SimpleFeature feature, SimpleFeatureType schema, MathTransform transform ); static SimpleFeatureType newFeatureType( AttributeDescriptor[] types, String name, URI ns,
            boolean isAbstract, SimpleFeatureType[] superTypes ); static SimpleFeatureType newFeatureType( AttributeDescriptor[] types, String name, URI ns,
            boolean isAbstract, SimpleFeatureType[] superTypes, AttributeDescriptor defaultGeometry ); static SimpleFeatureType newFeatureType( AttributeDescriptor[] types, String name, URI ns,
            boolean isAbstract, SimpleFeatureType[] superTypes, GeometryDescriptor   defaultGeometry ); static SimpleFeatureType newFeatureType( AttributeDescriptor[] types, String name, URI ns,
            boolean isAbstract ); static SimpleFeatureType newFeatureType( AttributeDescriptor[] types, String name, URI ns ); static SimpleFeatureType newFeatureType( AttributeDescriptor[] types, String name ); static List<FeatureType> getAncestors(FeatureType featureType); static boolean isDecendedFrom(FeatureType featureType, URI namespace, String typeName); static boolean isDecendedFrom(FeatureType featureType, FeatureType isParentType); static boolean equals( SimpleFeatureType typeA, SimpleFeatureType typeB ); static boolean equalsExact( SimpleFeatureType typeA, SimpleFeatureType typeB ); static boolean equals( List attributesA, List attributesB); static boolean equalsExact( List attributesA, List attributesB); static boolean equals( AttributeDescriptor attributesA[], AttributeDescriptor attributesB[] ); static boolean equalsExact( AttributeDescriptor attributesA[], AttributeDescriptor attributesB[] ); static boolean equalsAncestors( SimpleFeatureType typeA, SimpleFeatureType typeB ); static Set ancestors( SimpleFeatureType featureType ); static boolean equals( AttributeDescriptor a, AttributeDescriptor b); static boolean equalsExact( AttributeDescriptor a, AttributeDescriptor b); static boolean equalsId( SimpleFeatureType typeA, SimpleFeatureType typeB ); static final URI DEFAULT_NAMESPACE; final static SimpleFeatureType ABSTRACT_FEATURE_TYPE; final static NameImpl DEFAULT_TYPENAME; final static int ANY_LENGTH; static final SimpleFeatureType EMPTY; }