Refine search
/** * Returns the XSD object representing the contents of the schema. */ public final XSDSchema getSchema() throws IOException { if (schema == null) { synchronized (this) { if (schema == null) { LOGGER.fine("building schema for schema: " + getNamespaceURI()); schema = buildSchema(); } } } return schema; }
/** * Returns the url to the file definiing hte schema. * <p> * For schema which are defined by multiple files, this method should return the base schema * which includes all other files that define the schema. * </p> * @deprecated use {@link XSD#getSchemaLocation()}. */ public final String getSchemaFileURL() { return getXSD().getSchemaLocation(); }
protected List allDependencies() { LinkedList unpacked = new LinkedList(); Stack stack = new Stack(); stack.addAll(getDependencies()); while (!stack.isEmpty()) { XSD xsd = (XSD) stack.pop(); if (!unpacked.contains(xsd)) { unpacked.addFirst(xsd); stack.addAll(xsd.getDependencies()); } } return unpacked; }
/** * Creates the schema, returning <code>null</code> if the schema could not be created. * </p> * <code>namespaceURI</code> should not be <code>null</code>. All other parameters are ignored. * * @see XSDSchemaLocator#locateSchema(org.eclipse.xsd.XSDSchema, java.lang.String, java.lang.String, java.lang.String) */ public XSDSchema locateSchema(XSDSchema schema, String namespaceURI, String rawSchemaLocationURI, String resolvedSchemaLocationURI) { if (xsd.getNamespaceURI().equals(namespaceURI)) { try { return xsd.getSchema(); } catch (IOException e) { LOGGER.log(Level.WARNING, "Error occured getting schema", e); } } return null; }
context = configuration.setupContext(context); Map bindings = configuration.setupBindings(); BindingLoader bindingLoader = new BindingLoader(bindings); for (Iterator d = configuration.getXSD().getDependencies().iterator(); d.hasNext();) { XSD xsd = (XSD) d.next(); XSDSchema schema = xsd.getSchema(); mappings.putAll(configuration.getXSD().getSchema().getQNamePrefixToNamespaceMap()); } catch (IOException e) { throw new RuntimeException(e);
logger.finer( "No schemaLocation found, using '" + config.getNamespaceURI() + " " + config.getSchemaFileURL() ); locations = new String[] { config.getNamespaceURI(), config.getSchemaFileURL() }; schemas = new XSDSchema[] { config.getXSD().getSchema() }; } catch (IOException e) { throw (SAXException) new SAXException().initCause(e);
/** * Builds the schema from the .xsd file specified by {@link #getSchemaLocation()} * <p> * This method may be extended, but should not be overridden. * </p> */ protected XSDSchema buildSchema() throws IOException { //grab all the dependencies and create schema locators from the build // schemas List locators = new ArrayList(); List resolvers = new ArrayList(); for (Iterator d = allDependencies().iterator(); d.hasNext();) { XSD dependency = (XSD) d.next(); SchemaLocator locator = dependency.createSchemaLocator(); if (locator != null) { locators.add(locator); } SchemaLocationResolver resolver = dependency.createSchemaLocationResolver(); if (resolver != null) { resolvers.add(resolver); } } SchemaLocationResolver resolver = createSchemaLocationResolver(); if (resolver != null) { resolvers.add(resolver); } //parse the location of the xsd with all the locators for dependent // schemas return Schemas.parse(getSchemaLocation(), locators, resolvers); }
protected void addDependencies(Set dependencies) { dependencies.add(org.geotools.ows.v1_1.OWS.getInstance()); super.addDependencies(dependencies); }
public String toString() { return getNamespaceURI(); } }
/** * Convenience method for creating an instance of the schema for this configuration. * * @return The schema for this configuration. * @deprecated use {@link #getXSD()} and {@link XSD#getSchema()}. */ public XSDSchema schema() { try { return getXSD().getSchema(); } catch (IOException e) { throw new RuntimeException(e); } }
/** * @return The namespace of the configuration schema. */ public final String getNamespaceURI() { return getXSD().getNamespaceURI(); }
configuration.getContext() .registerComponentInstance("http://geotools.org/typeDefinition", type); XSDSchema schema = configuration.getXSD().getSchema();
/** * Suplements the schema built by the parent by adding hte aplication schema feature typs * defined in GeoServer. */ protected XSDSchema buildSchema() throws IOException { XSDSchema wfsSchema = super.buildSchema(); wfsSchema = schemaBuilder.addApplicationTypes(wfsSchema); return wfsSchema; } }
public PropertyValueCollection(FeatureCollection delegate, AttributeDescriptor descriptor) { super(delegate); this.descriptor = descriptor; this.typeMappingProfiles.add(XS.getInstance().getTypeMappingProfile()); this.typeMappingProfiles.add(GML.getInstance().getTypeMappingProfile()); }
locators.add(xsd.createSchemaLocator());
/** * Creates the schema, returning <code>null</code> if the schema could not be created. * </p> * <code>namespaceURI</code> should not be <code>null</code>. All other parameters are ignored. * * @see XSDSchemaLocator#locateSchema(org.eclipse.xsd.XSDSchema, java.lang.String, java.lang.String, java.lang.String) */ public XSDSchema locateSchema(XSDSchema schema, String namespaceURI, String rawSchemaLocationURI, String resolvedSchemaLocationURI) { if (canHandle(schema,namespaceURI,rawSchemaLocationURI,resolvedSchemaLocationURI)) { try { return xsd.getSchema(); } catch (IOException e) { LOGGER.log(Level.WARNING, "Error occured getting schema", e); } } return null; }
/** * Builds the schema from the .xsd file specified by {@link #getSchemaLocation()} * <p> * This method may be extended, but should not be overridden. * </p> */ protected XSDSchema buildSchema() throws IOException { //grab all the dependencies and create schema locators from the build // schemas List locators = new ArrayList(); List resolvers = new ArrayList(); for (Iterator d = allDependencies().iterator(); d.hasNext();) { XSD dependency = (XSD) d.next(); SchemaLocator locator = dependency.createSchemaLocator(); if (locator != null) { locators.add(locator); } SchemaLocationResolver resolver = dependency.createSchemaLocationResolver(); if (resolver != null) { resolvers.add(resolver); } } SchemaLocationResolver resolver = createSchemaLocationResolver(); if (resolver != null) { resolvers.add(resolver); } //parse the location of the xsd with all the locators for dependent // schemas return Schemas.parse(getSchemaLocation(), locators, resolvers); }
/** * The dependencies of this schema. */ public final Set getDependencies() { if (dependencies == null) { synchronized (this) { if (dependencies == null) { dependencies = new LinkedHashSet(); //bootstrap, every xsd depends on XS dependencies.add(XS.getInstance()); //call subclass hook addDependencies(dependencies); } } } return dependencies; }
public String toString() { return getNamespaceURI(); } }
/** * Convenience method for creating an instance of the schema for this configuration. * * @return The schema for this configuration. * @deprecated use {@link #getXSD()} and {@link XSD#getSchema()}. */ public XSDSchema schema() { try { return getXSD().getSchema(); } catch (IOException e) { throw new RuntimeException(e); } }