org.apache.woden.schema.Schema Maven / Gradle / Ivy
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.woden.schema;
import java.net.URI;
import org.apache.woden.XMLElement;
import org.apache.ws.commons.schema.XmlSchema;
/**
* This interface provides an abstract representation of an XML Schema referenced
* within the <wsdl:types> element. For example, via <xs:schema> or
* <xs:import>.
* It provides the namespace used as the target namespace of an inlined schema
* or as the imported namespace of a schema import.
* It provides a reference to the actual schema definition, represented by
* org.apache.ws.commons.schema.XmlSchema
.
* For applications that use other representations for XML Schema content,
* it also provides a reference to the org.apache.woden.XMLElement
* object that wraps the underlying <xs:schema> or <xs:import>
* element.
* It also indicates whether the schema is 'referenceable' by the surrounding
* WSDL document, as defined by the schema referenceability rules in the
* WSDL 2.0 spec.
*
*
* NOTE: non-XML type systems like DTD are not handled by this interface. They must be
* handled by WSDL 2.0 extension mechanisms.
*
* TODO Need to determine if this interface is suitable for use with other xml-based
* schema types like Relax NG or if some type of schema extension mechanism is required.
*
* @author John Kaputin ([email protected])
*/
public interface Schema {
/**
* Returns a URI representing the targetNamespace
attribute of a
* <xs:schema> element or the namespace
attribute of a
* <xs:import> element.
*
* @return a URI representing the schema's namespace
*/
public URI getNamespace();
/**
* Set the targetNamespace
attribute of a <xs:schema> element
* or the namespace
attribute of a <xs:import> element.
* @param namespace
*/
public void setNamespace(URI namespace);
/**
* Returns an XmlSchema
representing the schema definition inlined by
* a <xs:schema> element or imported by a <xs:import> element.
*
* @return the XmlSchema
representing schema definition.
*/
public XmlSchema getSchemaDefinition();
/**
* Sets the schema definition for an inlined schema or schema import to the specified
* XmlSchema
.
*
* @param schemaDef the XmlSchema
representing this schema
*/
public void setSchemaDefinition(XmlSchema schemaDef);
/**
* Returns the XMLElement representing the xs:schema
or xs:import
* element within the wsdl:types
element. This provides an 'wrapper' to the
* underlying XML Schema infoset for applications that need schema processing alternatives to
* Apache WS Commons XmlSchema.
*
* @return the XMLElement that wraps the underlying schema or schema import element
*/
public XMLElement getXMLElement();
/**
* Sets the XMLElement representing the underlying xs:schema
or xs:import
* element.
*
* @param xsdElement the XMLElement
*/
public void setXMLElement(XMLElement xsdElement);
}