01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.xml.impl;
17:
18: import org.eclipse.xsd.XSDNamedComponent;
19: import org.eclipse.xsd.XSDSchemaContent;
20: import org.geotools.xml.InstanceComponent;
21:
22: public abstract class InstanceComponentImpl implements
23: InstanceComponent {
24: /** namespace **/
25: String namespace;
26:
27: /** name **/
28: String name;
29:
30: /** text **/
31: StringBuffer text;
32:
33: public XSDNamedComponent getDeclaration() {
34: // TODO Auto-generated method stub
35: return null;
36: }
37:
38: public String getNamespace() {
39: return namespace;
40: }
41:
42: public void setNamespace(String namespace) {
43: this .namespace = namespace;
44: }
45:
46: public String getName() {
47: return name;
48: }
49:
50: public void setName(String name) {
51: this .name = name;
52: }
53:
54: public String getText() {
55: return (text != null) ? text.toString() : "";
56: }
57:
58: public void setText(String text) {
59: this .text = (text != null) ? new StringBuffer(text)
60: : new StringBuffer();
61: }
62:
63: public void addText(String text) {
64: if (this .text != null) {
65: this .text.append(text);
66: } else {
67: this .text = new StringBuffer(text);
68: }
69: }
70:
71: public void addText(char[] ch, int start, int length) {
72: if (text == null) {
73: text = new StringBuffer();
74: }
75:
76: text.append(ch, start, length);
77: }
78: }
|