325N/A/*
325N/A * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
325N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
325N/A *
325N/A * This code is free software; you can redistribute it and/or modify it
325N/A * under the terms of the GNU General Public License version 2 only, as
325N/A * published by the Free Software Foundation. Oracle designates this
325N/A * particular file as subject to the "Classpath" exception as provided
325N/A * by Oracle in the LICENSE file that accompanied this code.
325N/A *
325N/A * This code is distributed in the hope that it will be useful, but WITHOUT
325N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
325N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
325N/A * version 2 for more details (a copy is included in the LICENSE file that
325N/A * accompanied this code).
325N/A *
325N/A * You should have received a copy of the GNU General Public License version
325N/A * 2 along with this work; if not, write to the Free Software Foundation,
325N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
325N/A *
325N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
325N/A * or visit www.oracle.com if you need additional information or have any
325N/A * questions.
325N/A */
325N/A
325N/Apackage com.sun.xml.internal.xsom;
325N/A
325N/Aimport javax.xml.namespace.NamespaceContext;
325N/Aimport java.util.Iterator;
325N/Aimport java.util.Collection;
325N/A
325N/A/**
325N/A * Set of {@link XSSchema} objects.
325N/A *
325N/A * @author
325N/A * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
325N/A */
325N/Apublic interface XSSchemaSet
325N/A{
325N/A XSSchema getSchema(String targetNamespace);
325N/A XSSchema getSchema(int idx);
325N/A int getSchemaSize();
325N/A Iterator<XSSchema> iterateSchema();
325N/A
325N/A /**
325N/A * Gets all {@link XSSchema}s in a single collection.
325N/A */
325N/A Collection<XSSchema> getSchemas();
325N/A
325N/A XSType getType(String namespaceURI, String localName);
325N/A XSSimpleType getSimpleType(String namespaceURI, String localName);
325N/A XSAttributeDecl getAttributeDecl(String namespaceURI, String localName);
325N/A XSElementDecl getElementDecl(String namespaceURI, String localName);
325N/A XSModelGroupDecl getModelGroupDecl(String namespaceURI, String localName);
325N/A XSAttGroupDecl getAttGroupDecl(String namespaceURI, String localName);
325N/A XSComplexType getComplexType(String namespaceURI, String localName);
325N/A XSIdentityConstraint getIdentityConstraint(String namespaceURI, String localName);
325N/A
325N/A /** Iterates all element declarations in all the schemas. */
325N/A Iterator<XSElementDecl> iterateElementDecls();
325N/A /** Iterates all type definitions in all the schemas. */
325N/A Iterator<XSType> iterateTypes();
325N/A /** Iterates all atribute declarations in all the schemas. */
325N/A Iterator<XSAttributeDecl> iterateAttributeDecls();
325N/A /** Iterates all attribute group declarations in all the schemas. */
325N/A Iterator<XSAttGroupDecl> iterateAttGroupDecls();
325N/A /** Iterates all model group declarations in all the schemas. */
325N/A Iterator<XSModelGroupDecl> iterateModelGroupDecls();
325N/A /** Iterates all simple type definitions in all the schemas. */
325N/A Iterator<XSSimpleType> iterateSimpleTypes();
325N/A /** Iterates all complex type definitions in all the schemas. */
325N/A Iterator<XSComplexType> iterateComplexTypes();
325N/A /** Iterates all notation declarations in all the schemas. */
325N/A Iterator<XSNotation> iterateNotations();
325N/A /**
325N/A * Iterates all identity constraints in all the schemas.
325N/A */
325N/A Iterator<XSIdentityConstraint> iterateIdentityConstraints();
325N/A
325N/A // conceptually static methods
325N/A XSComplexType getAnyType();
325N/A XSSimpleType getAnySimpleType();
325N/A XSContentType getEmpty();
325N/A
325N/A /**
325N/A * Evaluates a schema component designator against this schema component
325N/A * and returns the resulting schema components.
325N/A *
325N/A * @throws IllegalArgumentException
325N/A * if SCD is syntactically incorrect.
325N/A * @param scd
325N/A * Schema component designator. See {@link SCD} for more details.
325N/A * @param nsContext
325N/A * The namespace context in which SCD is evaluated. Cannot be null.
325N/A * @return
325N/A * Can be empty but never null.
325N/A */
325N/A Collection<XSComponent> select(String scd, NamespaceContext nsContext);
325N/A
325N/A /**
325N/A * Evaluates a schema component designator against this schema component
325N/A * and returns the first resulting schema component.
325N/A *
325N/A * @throws IllegalArgumentException
325N/A * if SCD is syntactically incorrect.
325N/A * @param scd
325N/A * Schema component designator. See {@link SCD} for more details.
325N/A * @param nsContext
325N/A * The namespace context in which SCD is evaluated. Cannot be null.
325N/A * @return
325N/A * null if the SCD didn't match anything. If the SCD matched more than one node,
325N/A * the first one will be returned.
325N/A */
325N/A XSComponent selectSingle(String scd, NamespaceContext nsContext);
325N/A}