private static void createClasses( AppSchema schema, FeatureType root, HashMap<QName, FeatureClass> featClasses ) throws IOException { if ( root != null ) { createFeatureFile( root, featClasses ); } FeatureType[] directSubtypes = schema.getDirectSubtypes( root ); if ( directSubtypes != null && directSubtypes.length > 0 ) { for ( FeatureType dft : directSubtypes ) { if ( dft != null ) { createClasses( schema, dft, featClasses ); } } } }
private static void writeLayer( HashSet<FeatureType> visited, XMLStreamWriter out, FeatureType ft, String storeId ) throws XMLStreamException { if ( visited.contains( ft ) || ft == null ) { return; } visited.add( ft ); out.writeCharacters( "\n" ); out.writeStartElement( ns, "RequestableLayer" ); XMLAdapter.writeElement( out, ns, "Name", ft.getName().getLocalPart() ); XMLAdapter.writeElement( out, ns, "Title", ft.getName().getLocalPart() ); for ( FeatureType sub : ft.getSchema().getDirectSubtypes( ft ) ) { writeLayer( visited, out, sub, storeId ); } XMLAdapter.writeElement( out, ns, "FeatureStoreId", storeId ); out.writeEndElement(); out.writeCharacters( "\n" ); }
private static void createClassHierarchy( AppSchema schema, FeatureType currentType, FeatureClass parent, HashMap<QName, FeatureClass> featClasses ) throws IOException { FeatureClass newClass = null; if ( currentType != null ) { if ( parent != null ) { newClass = new FeatureClass( currentType, parent ); } else { newClass = new RootFeature( currentType ); } featClasses.put( currentType.getName(), newClass ); } FeatureType[] directSubtypes = schema.getDirectSubtypes( currentType ); if ( directSubtypes != null && directSubtypes.length > 0 ) { for ( FeatureType dft : directSubtypes ) { if ( dft != null ) { createClassHierarchy( schema, dft, newClass, featClasses ); } } } }
AppSchema schema = ft.getSchema(); if ( schema != null ) { hasSubTypes = schema.getDirectSubtypes( ft ).length > 0;
private static void createGraph( BufferedWriter out, AppSchema schema, FeatureType root ) throws IOException { if ( root != null ) { addNode( out, root ); } FeatureType[] directSubtypes = schema.getDirectSubtypes( root ); if ( directSubtypes != null && directSubtypes.length > 0 ) { for ( FeatureType dft : directSubtypes ) { if ( dft != null ) { GraphvizDot.writeEdge( dotName( root ), dotName( dft ), null, out ); createGraph( out, schema, dft ); } } } }