@Override public List<FeatureType> getFeatureTypes( String namespace, boolean includeCollections, boolean includeAbstracts ) { List<FeatureType> fts = new ArrayList<FeatureType>( ftNameToFt.values().size() ); for ( FeatureType ft : ftNameToFt.values() ) { if ( namespace == null || namespace.equals( ft.getName().getNamespaceURI() ) ) { if ( ( includeAbstracts || !ft.isAbstract() ) && ( includeCollections || !( ft instanceof FeatureCollectionType ) ) ) { fts.add( ft ); } } } return fts; }
@Override public FeatureType[] getConcreteSubtypes( FeatureType ft ) { FeatureType[] directSubtypes = getDirectSubtypes( ft ); List<FeatureType> result = new ArrayList<FeatureType>( ftNameToFt.size() ); if ( directSubtypes != null && directSubtypes.length > 0 ) { for ( FeatureType son : directSubtypes ) { if ( son != null ) { if ( !son.isAbstract() ) { result.add( son ); } FeatureType[] sons = getSubtypes( son ); if ( sons != null && sons.length > 0 ) { for ( FeatureType sonSon : sons ) { if ( !sonSon.isAbstract() ) { result.add( sonSon ); } } } } } } return result.toArray( new FeatureType[result.size()] ); }
private static List<String> createAttributes( FeatureType ft ) { List<String> result = new LinkedList<String>(); if ( ft.isAbstract() ) { result.add( GraphvizDot.getFillColorDef( "red" ) ); result.add( GraphvizDot.getShapeDef( "triangle" ) ); } else { result.add( GraphvizDot.getFillColorDef( "cyan" ) ); } return result; }
private static void printFt( FeatureType ft, Set<String> ftNames, Set<String> propNames ) { System.out.println( "\n - feature type '" + ft.getName() + "'" + ( ft.isAbstract() ? " (abstract)" : "" ) ); ftNames.add( ft.getName().getLocalPart() ); for ( PropertyType pt : ft.getPropertyDeclarations() ) { propNames.add( pt.getName().getLocalPart() ); String ptName = pt.getName().getNamespaceURI().equals( ft.getName().getNamespaceURI() ) ? pt.getName().getLocalPart() : pt.getName().toString(); System.out.println( " - '" + ptName + "', minOccurs=" + pt.getMinOccurs() + ", maxOccurs=" + pt.getMaxOccurs() + ", type: " + pt.getClass().getSimpleName() ); } }
private static void printFtHierarchy( AppSchema schema, Set<String> ftNames, Set<String> propNames ) { int concrete = 0; for ( FeatureType ft : schema.getFeatureTypes() ) { if ( !ft.isAbstract() ) { concrete++; } printFt( ft, ftNames, propNames ); } System.out.println( schema.getFeatureTypes().length + " feature types (" + concrete + " concrete)" ); }
public FeatureClass( FeatureType ft, FeatureClass parent ) { super( ft.getName(), D_PACKAGE, PACKAGE_DIR, null, false, ft.isAbstract() ); this.ft = ft; this.baseType = parent; AppSchema schema = ft.getSchema(); propertyDeclarations = schema.getNewPropertyDecls( ft ); }
writer.writeAttribute( "name", typeName ); if ( ft.isAbstract() ) { writer.writeAttribute( "abstract", "true" );
if ( !ft.isAbstract() ) { ftNames.put( ft.getName().toString(), ft.getName() );
if ( ft.isAbstract() ) { writer.writeAttribute( "abstract", "true" );
/** * Creates a new {@link IdAnalyzer} instance for the given {@link MappedAppSchema}. * * @param schema application schema with mapping information, must not be <code>null</code> */ public IdAnalyzer( MappedAppSchema schema ) { this.schema = schema; for ( FeatureType ft : schema.getFeatureTypes() ) { if ( !ft.isAbstract() ) { FeatureTypeMapping ftMapping = schema.getFtMapping( ft.getName() ); if ( ftMapping != null ) { FIDMapping fidMapping = ftMapping.getFidMapping(); if ( fidMapping != null ) { LOG.debug( fidMapping.getPrefix() + " -> " + ft.getName() ); prefixToFt.put( fidMapping.getPrefix(), ft ); } } } } prefixKeysSortedByLengthDesc = prefixToFt.keySet().toArray( new String[0] ); sortByLengthDescending( prefixKeysSortedByLengthDesc ); }
if ( mapping.getValueFtName() != null ) { ftName = mapping.getValueFtName(); if ( getSchema().getFeatureType( ftName ).isAbstract() ) {