001: /*
002: * The contents of this file are subject to the terms
003: * of the Common Development and Distribution License
004: * (the "License"). You may not use this file except
005: * in compliance with the License.
006: *
007: * You can obtain a copy of the license at
008: * https://jwsdp.dev.java.net/CDDLv1.0.html
009: * See the License for the specific language governing
010: * permissions and limitations under the License.
011: *
012: * When distributing Covered Code, include this CDDL
013: * HEADER in each file and include the License file at
014: * https://jwsdp.dev.java.net/CDDLv1.0.html If applicable,
015: * add the following below this CDDL HEADER, with the
016: * fields enclosed by brackets "[]" replaced with your
017: * own identifying information: Portions Copyright [yyyy]
018: * [name of copyright owner]
019: */
020: package com.sun.xml.xsom;
021:
022: import com.sun.xml.xsom.parser.SchemaDocument;
023:
024: import java.util.Iterator;
025: import java.util.Map;
026:
027: /**
028: * Schema.
029: *
030: * Container of declarations that belong to the same target namespace.
031: *
032: * @author
033: * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
034: */
035: public interface XSSchema extends XSComponent {
036: /**
037: * Gets the target namespace of the schema.
038: *
039: * @return
040: * can be empty, but never be null.
041: */
042: String getTargetNamespace();
043:
044: /**
045: * Gets all the {@link XSAttributeDecl}s in this schema
046: * keyed by their local names.
047: */
048: Map<String, XSAttributeDecl> getAttributeDecls();
049:
050: Iterator<XSAttributeDecl> iterateAttributeDecls();
051:
052: XSAttributeDecl getAttributeDecl(String localName);
053:
054: /**
055: * Gets all the {@link XSElementDecl}s in this schema.
056: */
057: Map<String, XSElementDecl> getElementDecls();
058:
059: Iterator<XSElementDecl> iterateElementDecls();
060:
061: XSElementDecl getElementDecl(String localName);
062:
063: /**
064: * Gets all the {@link XSAttGroupDecl}s in this schema.
065: */
066: Map<String, XSAttGroupDecl> getAttGroupDecls();
067:
068: Iterator<XSAttGroupDecl> iterateAttGroupDecls();
069:
070: XSAttGroupDecl getAttGroupDecl(String localName);
071:
072: /**
073: * Gets all the {@link XSModelGroupDecl}s in this schema.
074: */
075: Map<String, XSModelGroupDecl> getModelGroupDecls();
076:
077: Iterator<XSModelGroupDecl> iterateModelGroupDecls();
078:
079: XSModelGroupDecl getModelGroupDecl(String localName);
080:
081: /**
082: * Gets all the {@link XSType}s in this schema (union of
083: * {@link #getSimpleTypes()} and {@link #getComplexTypes()}
084: */
085: Map<String, XSType> getTypes();
086:
087: Iterator<XSType> iterateTypes();
088:
089: XSType getType(String localName);
090:
091: /**
092: * Gets all the {@link XSSimpleType}s in this schema.
093: */
094: Map<String, XSSimpleType> getSimpleTypes();
095:
096: Iterator<XSSimpleType> iterateSimpleTypes();
097:
098: XSSimpleType getSimpleType(String localName);
099:
100: /**
101: * Gets all the {@link XSComplexType}s in this schema.
102: */
103: Map<String, XSComplexType> getComplexTypes();
104:
105: Iterator<XSComplexType> iterateComplexTypes();
106:
107: XSComplexType getComplexType(String localName);
108:
109: /**
110: * Gets all the {@link XSNotation}s in this schema.
111: */
112: Map<String, XSNotation> getNotations();
113:
114: Iterator<XSNotation> iterateNotations();
115:
116: XSNotation getNotation(String localName);
117:
118: /**
119: * Gets all the {@link XSIdentityConstraint}s in this schema,
120: * keyed by their names.
121: */
122: Map<String, XSIdentityConstraint> getIdentityConstraints();
123:
124: /**
125: * Gets the identity constraint of the given name, or null if not found.
126: */
127: XSIdentityConstraint getIdentityConstraint(String localName);
128:
129: /**
130: * Sine an {@link XSSchema} is not necessarily defined in
131: * one schema document (for example one schema can span across
132: * many documents through <xs:include>s.),
133: * so this method always returns null.
134: *
135: * @deprecated
136: * Since this method always returns null, if you are calling
137: * this method from {@link XSSchema} and not from {@link XSComponent},
138: * there's something wrong with your code.
139: */
140: SchemaDocument getSourceDocument();
141:
142: /**
143: * Gets the root schema set that includes this schema.
144: *
145: * @return never null.
146: */
147: XSSchemaSet getRoot();
148: }
|