001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2004-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.schema;
017:
018: import java.net.URI;
019: import java.util.Map;
020:
021: import org.xml.sax.Attributes;
022:
023: /**
024: * <p>
025: * This interface is intended to represent an XML Schema complexType. This
026: * interface extends the generic XML schema type interface to represent datum
027: * within nested elements.
028: * </p>
029: *
030: * @author dzwiers www.refractions.net
031: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/xml/src/main/java/org/geotools/xml/schema/ComplexType.java $
032: */
033: public interface ComplexType extends Type {
034: /**
035: * <p>
036: * This is used to represent the heirarchy represented within an xml schema
037: * document(s). This is particularily useful, as the parent will have the
038: * first attempt to create a real (non Object[]) value of the element. For
039: * more information see getValue.
040: * </p>
041: *
042: *
043: * @see Type#getValue(Element, ElementValue[], Attributes)
044: */
045: public Type getParent();
046:
047: /**
048: * Returns true when the complexType should be considered abstract, as
049: * defined by the XML schema of which this complex type definition is a
050: * part.
051: *
052: */
053: public boolean isAbstract();
054:
055: /**
056: * This methos represents the potential 'anyAttribute' declaration's
057: * namespace attribute which may occur within a complex type definition.
058: *
059: */
060: public String getAnyAttributeNameSpace();
061:
062: /**
063: * The set of attributes required by this complex type declaration. As per
064: * the xml schema definition, there is not an implied order to the
065: * attributes. For performance reasons an implementor may wich to order
066: * the attributes from most common to least commonly used attributes.
067: *
068: */
069: public Attribute[] getAttributes();
070:
071: /**
072: * Specifies a mask which denotes which substitution mechanisms may be used
073: * for this complex type definition.
074: *
075: *
076: * @see Schema#EXTENSION
077: * @see Schema#RESTRICTION
078: * @see Schema#ALL
079: */
080: public int getBlock();
081:
082: /**
083: * Returns the child element representing the structure of nested child
084: * nodes (if any are allowed).
085: *
086: *
087: * @see ElementGrouping
088: */
089: public ElementGrouping getChild();
090:
091: public Element[] getChildElements();
092:
093: /**
094: * Specifies a mask which denotes which substitution mechanisms prohibited
095: * for use by child definitions of this complex type.
096: *
097: *
098: * @see Schema#EXTENSION
099: * @see Schema#RESTRICTION
100: * @see Schema#ALL
101: */
102: public int getFinal();
103:
104: /**
105: * Returns the xml schema id of this complexType if one exists, null
106: * otherwise.
107: *
108: */
109: public String getId();
110:
111: /**
112: * Returns true if this complexType allows mixed content (Child elements
113: * and a String value).
114: *
115: */
116: public boolean isMixed();
117:
118: /**
119: * This method is used to publish whether this complexType is at the root
120: * of an inheritance tree, or a leaf within an inheritance tree. This
121: * method should return true when the complexType is not a root of an
122: * inheritance tree.
123: *
124: */
125: public boolean isDerived();
126:
127: /**
128: * This method is a directive to the parser whether to keep the data around
129: * in memory for post processing. Generally this should return True,
130: * except when streaming.
131: *
132: * @param element DOCUMENT ME!
133: * @param hints DOCUMENT ME!
134: *
135: * @return True, except when streaming the element.
136: */
137: public boolean cache(Element element, Map hints);
138:
139: }
|