aoqi@0: /* aoqi@0: * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: * aoqi@0: * This code is free software; you can redistribute it and/or modify it aoqi@0: * under the terms of the GNU General Public License version 2 only, as aoqi@0: * published by the Free Software Foundation. Oracle designates this aoqi@0: * particular file as subject to the "Classpath" exception as provided aoqi@0: * by Oracle in the LICENSE file that accompanied this code. aoqi@0: * aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that aoqi@0: * accompanied this code). aoqi@0: * aoqi@0: * You should have received a copy of the GNU General Public License version aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: * aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: * or visit www.oracle.com if you need additional information or have any aoqi@0: * questions. aoqi@0: */ aoqi@0: aoqi@0: package com.sun.xml.internal.xsom; aoqi@0: aoqi@0: import com.sun.xml.internal.xsom.parser.SchemaDocument; aoqi@0: aoqi@0: import java.util.Iterator; aoqi@0: import java.util.Map; aoqi@0: aoqi@0: /** aoqi@0: * Schema. aoqi@0: * aoqi@0: * Container of declarations that belong to the same target namespace. aoqi@0: * aoqi@0: * @author aoqi@0: * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) aoqi@0: */ aoqi@0: public interface XSSchema extends XSComponent aoqi@0: { aoqi@0: /** aoqi@0: * Gets the target namespace of the schema. aoqi@0: * aoqi@0: * @return aoqi@0: * can be empty, but never be null. aoqi@0: */ aoqi@0: String getTargetNamespace(); aoqi@0: aoqi@0: /** aoqi@0: * Gets all the {@link XSAttributeDecl}s in this schema aoqi@0: * keyed by their local names. aoqi@0: */ aoqi@0: Map getAttributeDecls(); aoqi@0: Iterator iterateAttributeDecls(); aoqi@0: XSAttributeDecl getAttributeDecl(String localName); aoqi@0: aoqi@0: /** aoqi@0: * Gets all the {@link XSElementDecl}s in this schema. aoqi@0: */ aoqi@0: Map getElementDecls(); aoqi@0: Iterator iterateElementDecls(); aoqi@0: XSElementDecl getElementDecl(String localName); aoqi@0: aoqi@0: /** aoqi@0: * Gets all the {@link XSAttGroupDecl}s in this schema. aoqi@0: */ aoqi@0: Map getAttGroupDecls(); aoqi@0: Iterator iterateAttGroupDecls(); aoqi@0: XSAttGroupDecl getAttGroupDecl(String localName); aoqi@0: aoqi@0: /** aoqi@0: * Gets all the {@link XSModelGroupDecl}s in this schema. aoqi@0: */ aoqi@0: Map getModelGroupDecls(); aoqi@0: Iterator iterateModelGroupDecls(); aoqi@0: XSModelGroupDecl getModelGroupDecl(String localName); aoqi@0: aoqi@0: /** aoqi@0: * Gets all the {@link XSType}s in this schema (union of aoqi@0: * {@link #getSimpleTypes()} and {@link #getComplexTypes()} aoqi@0: */ aoqi@0: Map getTypes(); aoqi@0: Iterator iterateTypes(); aoqi@0: XSType getType(String localName); aoqi@0: aoqi@0: /** aoqi@0: * Gets all the {@link XSSimpleType}s in this schema. aoqi@0: */ aoqi@0: Map getSimpleTypes(); aoqi@0: Iterator iterateSimpleTypes(); aoqi@0: XSSimpleType getSimpleType(String localName); aoqi@0: aoqi@0: /** aoqi@0: * Gets all the {@link XSComplexType}s in this schema. aoqi@0: */ aoqi@0: Map getComplexTypes(); aoqi@0: Iterator iterateComplexTypes(); aoqi@0: XSComplexType getComplexType(String localName); aoqi@0: aoqi@0: /** aoqi@0: * Gets all the {@link XSNotation}s in this schema. aoqi@0: */ aoqi@0: Map getNotations(); aoqi@0: Iterator iterateNotations(); aoqi@0: XSNotation getNotation(String localName); aoqi@0: aoqi@0: /** aoqi@0: * Gets all the {@link XSIdentityConstraint}s in this schema, aoqi@0: * keyed by their names. aoqi@0: */ aoqi@0: Map getIdentityConstraints(); aoqi@0: aoqi@0: /** aoqi@0: * Gets the identity constraint of the given name, or null if not found. aoqi@0: */ aoqi@0: XSIdentityConstraint getIdentityConstraint(String localName); aoqi@0: aoqi@0: /** aoqi@0: * Sine an {@link XSSchema} is not necessarily defined in aoqi@0: * one schema document (for example one schema can span across aoqi@0: * many documents through <xs:include>s.), aoqi@0: * so this method always returns null. aoqi@0: * aoqi@0: * @deprecated aoqi@0: * Since this method always returns null, if you are calling aoqi@0: * this method from {@link XSSchema} and not from {@link XSComponent}, aoqi@0: * there's something wrong with your code. aoqi@0: */ aoqi@0: SchemaDocument getSourceDocument(); aoqi@0: aoqi@0: /** aoqi@0: * Gets the root schema set that includes this schema. aoqi@0: * aoqi@0: * @return never null. aoqi@0: */ aoqi@0: XSSchemaSet getRoot(); aoqi@0: }