001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation;
009: * version 2.1 of the License.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: */
016: package org.geotools.xml;
017:
018: import java.util.List;
019:
020: import javax.xml.namespace.QName;
021:
022: import org.eclipse.xsd.XSDAttributeDeclaration;
023: import org.eclipse.xsd.XSDAttributeGroupDefinition;
024: import org.eclipse.xsd.XSDComplexTypeDefinition;
025: import org.eclipse.xsd.XSDElementDeclaration;
026: import org.eclipse.xsd.XSDSchema;
027: import org.eclipse.xsd.XSDSimpleTypeDefinition;
028: import org.eclipse.xsd.XSDTypeDefinition;
029:
030: public interface SchemaIndex {
031: /**
032: * @return The schema itself.
033: */
034: XSDSchema[] getSchemas();
035:
036: /**
037: * Returns the element declaration with the specified qualified name.
038: *
039: * @param qName the qualified name of the element.
040: *
041: * @return The element declaration, or null if no such element declaration
042: * exists.
043: */
044: XSDElementDeclaration getElementDeclaration(QName qName);
045:
046: /**
047: * Returns the attribute declaration with the specified qualified name.
048: *
049: * @param qName the qualified name of the attribute.
050: *
051: * @return The attribute declaration, or null if no such attribute
052: * declaration exists.
053: */
054: XSDAttributeDeclaration getAttributeDeclaration(QName qName);
055:
056: /**
057: * Returns the attribute group definition with the specified qualified name.
058: *
059: * @param qName the qualified name of the attribute group.
060: *
061: * @return The attribute group definition, or null if no such attribute
062: * group definition exists.
063: */
064: XSDAttributeGroupDefinition getAttributeGroupDefinition(QName qName);
065:
066: /**
067: * Returns the complex type definition with the specified qualified name.
068: *
069: * @param qName qualified name of the complex type.
070: *
071: * @return The complex type definition, or null if no such complex type
072: * definition exists.
073: */
074: XSDComplexTypeDefinition getComplexTypeDefinition(QName qName);
075:
076: /**
077: * Returns the simple type definition with the specified qualified name.
078: *
079: * @param qName qualified name of the simple type.
080: *
081: * @return The simple type definition, or null if no such simple type
082: * definition exists.
083: */
084: XSDSimpleTypeDefinition getSimpleTypeDefinition(QName qName);
085:
086: /**
087: * Returns the type definition with the specified qualified name.
088: *
089: * @param qName qualified name of the type.
090: *
091: * @return The type definition, or null if no such type definition exists.
092: */
093: XSDTypeDefinition getTypeDefinition(QName qName);
094:
095: /**
096: * Returns a child element specified by name of a parent element.
097: *
098: * @param parent The parent element.
099: * @param childName The name of the child.
100: *
101: * @return The element declaration, or null if no such child exists.
102: */
103: XSDElementDeclaration getChildElement(XSDElementDeclaration parent,
104: QName childName);
105:
106: /**
107: * Returns a list of the particles which correspond to child element declarations.
108: *
109: * @param parent The parent element.
110: *
111: * @return A list of {@link org.eclipse.xsd.XSDParticle}.
112: */
113: List getChildElementParticles(XSDElementDeclaration parent);
114:
115: /**
116: * Returns the attributes of a specified elements.
117: *
118: * @param element The element.
119: *
120: * @return The list of attributed definied for the element.
121: */
122: List getAttributes(XSDElementDeclaration element);
123: }
|