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.impl;
017:
018: import java.net.URI;
019:
020: import org.geotools.xml.schema.Element;
021: import org.geotools.xml.schema.ElementGrouping;
022: import org.geotools.xml.schema.Group;
023:
024: /**
025: * <p>
026: * DOCUMENT ME!
027: * </p>
028: *
029: * @author dzwiers
030: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/xml/src/main/java/org/geotools/xml/schema/impl/GroupGT.java $
031: */
032: public class GroupGT implements Group {
033: private ElementGrouping child;
034: private String id;
035: private String name;
036: private URI namespace;
037: private int min;
038: private int max;
039:
040: private GroupGT() {
041: // do nothing
042: }
043:
044: /**
045: * Creates a new GroupGT object.
046: *
047: * @param id DOCUMENT ME!
048: * @param name DOCUMENT ME!
049: * @param namespace DOCUMENT ME!
050: * @param child DOCUMENT ME!
051: * @param min DOCUMENT ME!
052: * @param max DOCUMENT ME!
053: */
054: public GroupGT(String id, String name, URI namespace,
055: ElementGrouping child, int min, int max) {
056: this .id = id;
057: this .name = name;
058: name.toCharArray();
059: this .namespace = namespace;
060: this .child = child;
061: this .min = min;
062: this .max = max;
063: }
064:
065: /**
066: * @see org.geotools.xml.schema.Group#getChild()
067: */
068: public ElementGrouping getChild() {
069: return child;
070: }
071:
072: /**
073: * @see org.geotools.xml.schema.Group#getId()
074: */
075: public String getId() {
076: return id;
077: }
078:
079: /**
080: * @see org.geotools.xml.schema.ElementGrouping#getMaxOccurs()
081: */
082: public int getMaxOccurs() {
083: return max;
084: }
085:
086: /**
087: * @see org.geotools.xml.schema.ElementGrouping#getMinOccurs()
088: */
089: public int getMinOccurs() {
090: return min;
091: }
092:
093: /**
094: * @see org.geotools.xml.schema.Group#getName()
095: */
096: public String getName() {
097: return name;
098: }
099:
100: /**
101: * @see org.geotools.xml.schema.Group#getNamespace()
102: */
103: public URI getNamespace() {
104: return namespace;
105: }
106:
107: /**
108: * @see org.geotools.xml.schema.ElementGrouping#getGrouping()
109: */
110: public int getGrouping() {
111: return GROUP;
112: }
113:
114: /**
115: * @see org.geotools.xml.schema.ElementGrouping#findChildElement(java.lang.String)
116: */
117: public Element findChildElement(String name1) {
118: return (child == null) ? null : child.findChildElement(name1);
119: }
120:
121: public Element findChildElement(String localName, URI namespaceURI) {
122: return (child == null) ? null : child.findChildElement(
123: localName, namespaceURI);
124: }
125: }
|