001: /*
002: * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: package com.sun.xml.internal.xsom;
027:
028: import com.sun.xml.internal.xsom.parser.SchemaDocument;
029:
030: import java.util.Iterator;
031: import java.util.Map;
032:
033: /**
034: * Schema.
035: *
036: * Container of declarations that belong to the same target namespace.
037: *
038: * @author
039: * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
040: */
041: public interface XSSchema extends XSComponent {
042: /**
043: * Gets the target namespace of the schema.
044: *
045: * @return
046: * can be empty, but never be null.
047: */
048: String getTargetNamespace();
049:
050: /**
051: * Gets all the {@link XSAttributeDecl}s in this schema
052: * keyed by their local names.
053: */
054: Map<String, XSAttributeDecl> getAttributeDecls();
055:
056: Iterator<XSAttributeDecl> iterateAttributeDecls();
057:
058: XSAttributeDecl getAttributeDecl(String localName);
059:
060: /**
061: * Gets all the {@link XSElementDecl}s in this schema.
062: */
063: Map<String, XSElementDecl> getElementDecls();
064:
065: Iterator<XSElementDecl> iterateElementDecls();
066:
067: XSElementDecl getElementDecl(String localName);
068:
069: /**
070: * Gets all the {@link XSAttGroupDecl}s in this schema.
071: */
072: Map<String, XSAttGroupDecl> getAttGroupDecls();
073:
074: Iterator<XSAttGroupDecl> iterateAttGroupDecls();
075:
076: XSAttGroupDecl getAttGroupDecl(String localName);
077:
078: /**
079: * Gets all the {@link XSModelGroupDecl}s in this schema.
080: */
081: Map<String, XSModelGroupDecl> getModelGroupDecls();
082:
083: Iterator<XSModelGroupDecl> iterateModelGroupDecls();
084:
085: XSModelGroupDecl getModelGroupDecl(String localName);
086:
087: /**
088: * Gets all the {@link XSType}s in this schema (union of
089: * {@link #getSimpleTypes()} and {@link #getComplexTypes()}
090: */
091: Map<String, XSType> getTypes();
092:
093: Iterator<XSType> iterateTypes();
094:
095: XSType getType(String localName);
096:
097: /**
098: * Gets all the {@link XSSimpleType}s in this schema.
099: */
100: Map<String, XSSimpleType> getSimpleTypes();
101:
102: Iterator<XSSimpleType> iterateSimpleTypes();
103:
104: XSSimpleType getSimpleType(String localName);
105:
106: /**
107: * Gets all the {@link XSComplexType}s in this schema.
108: */
109: Map<String, XSComplexType> getComplexTypes();
110:
111: Iterator<XSComplexType> iterateComplexTypes();
112:
113: XSComplexType getComplexType(String localName);
114:
115: /**
116: * Gets all the {@link XSNotation}s in this schema.
117: */
118: Map<String, XSNotation> getNotations();
119:
120: Iterator<XSNotation> iterateNotations();
121:
122: XSNotation getNotation(String localName);
123:
124: /**
125: * Gets all the {@link XSIdentityConstraint}s in this schema,
126: * keyed by their names.
127: */
128: Map<String, XSIdentityConstraint> getIdentityConstraints();
129:
130: /**
131: * Gets the identity constraint of the given name, or null if not found.
132: */
133: XSIdentityConstraint getIdentityConstraint(String localName);
134:
135: /**
136: * Sine an {@link XSSchema} is not necessarily defined in
137: * one schema document (for example one schema can span across
138: * many documents through <xs:include>s.),
139: * so this method always returns null.
140: *
141: * @deprecated
142: * Since this method always returns null, if you are calling
143: * this method from {@link XSSchema} and not from {@link XSComponent},
144: * there's something wrong with your code.
145: */
146: SchemaDocument getSourceDocument();
147: }
|