public static Set ancestors(SimpleFeatureType featureType) { if (featureType == null || getAncestors(featureType).isEmpty()) { return Collections.EMPTY_SET; } return new HashSet(getAncestors(featureType)); }
/** * This order is to be respected, based on Ancestors and so on. * * <p>This method is "faster" then actually constructing the merged AttribtueTypes. */ public List getNames(SimpleFeatureType featureType, List names) { if (featureType == null || featureType.getAttributeDescriptors() == null) { return names; } List ancestors = FeatureTypes.getAncestors(featureType); if (ancestors != null && !ancestors.isEmpty()) { for (int i = 0, length = ancestors.size(); i < length; i++) { SimpleFeatureType superType = (SimpleFeatureType) ancestors.get(i); getNames(superType, names); } } List attributes = featureType.getAttributeDescriptors(); if (attributes != null && !attributes.isEmpty()) { for (int i = 0, length = attributes.size(); i < length; i++) { AttributeDescriptor type = (AttributeDescriptor) attributes.get(i); String name = type.getLocalName(); if (!names.contains(name)) { names.add(name); } } } return names; }
private List restriction(SimpleFeatureType featureType, String name, List filters) { List ancestors = FeatureTypes.getAncestors(featureType); if (ancestors != null && !ancestors.isEmpty()) { for (int i = 0, length = ancestors.size(); i < length; i++) { SimpleFeatureType superType = (SimpleFeatureType) ancestors.get(i); filters = restriction(superType, name, filters); } } List attributes = featureType.getAttributeDescriptors(); if (attributes != null && !attributes.isEmpty()) { for (int i = 0, length = attributes.size(); i < length; i++) { AttributeDescriptor type = (AttributeDescriptor) attributes.get(i); if (name.equals(type.getLocalName())) { filters = override(filters, type.getType().getRestrictions()); } } } return filters; }
List ancestors = FeatureTypes.getAncestors(featureType); if (ancestors != null && !ancestors.isEmpty()) { for (int i = 0, length = ancestors.size(); i < length; i++) {
List<FeatureType> ancestors = getAncestors(featureType); for (FeatureType superType : ancestors) { if (namespace == null) {
@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 Set ancestors( SimpleFeatureType featureType ) { if (featureType == null || getAncestors(featureType).isEmpty()) { return Collections.EMPTY_SET; } return new HashSet(getAncestors(featureType)); }
"Ancestors of Feature, nearest first", Collections.<FeatureType>emptyList(), FeatureTypes.getAncestors(BasicFeatureTypes.FEATURE)); FeatureTypes.getAncestors(typeA)); FeatureTypes.getAncestors(typeB)); FeatureTypes.getAncestors(typeC));
/** * This order is to be respected, based on Ancestors and so on. * <p> * This method is "faster" then actually constructing the merged * AttribtueTypes. * </p> */ public List getNames( SimpleFeatureType featureType, List names ){ if( featureType == null || featureType.getAttributeDescriptors() == null ){ return names; } List ancestors = FeatureTypes.getAncestors(featureType); if( ancestors != null && !ancestors.isEmpty() ){ for( int i=0, length = ancestors.size(); i<length; i++ ){ SimpleFeatureType superType = (SimpleFeatureType) ancestors.get(i); getNames( superType, names ); } } List attributes = featureType.getAttributeDescriptors(); if( attributes != null && !attributes.isEmpty() ){ for( int i=0, length = attributes.size(); i<length; i++ ){ AttributeDescriptor type = (AttributeDescriptor) attributes.get(i); String name = type.getLocalName(); if( !names.contains( name )){ names.add( name ); } } } return names; }
private List restriction( SimpleFeatureType featureType, String name, List filters ){ List ancestors = FeatureTypes.getAncestors(featureType); if( ancestors != null && !ancestors.isEmpty()){ for( int i=0, length = ancestors.size(); i<length; i++ ){ SimpleFeatureType superType = (SimpleFeatureType) ancestors.get(i); filters = restriction( superType, name, filters ); } } List attributes = featureType.getAttributeDescriptors(); if( attributes != null && !attributes.isEmpty()){ for( int i=0, length = attributes.size(); i<length; i++ ){ AttributeDescriptor type = (AttributeDescriptor) attributes.get(i); if( name.equals( type.getLocalName() )){ filters = override( filters, type.getType().getRestrictions() ); } } } return filters; }
List ancestors = FeatureTypes.getAncestors(featureType); if( ancestors != null && !ancestors.isEmpty()){ for( int i=0, length = ancestors.size(); i<length; i++ ){
if (featureType == null) return false; List<FeatureType> ancestors = getAncestors(featureType); for (FeatureType superType : ancestors) { if (namespace == null) {