Revision 697
org.gvsig.xmlschema/library/tags/org.gvsig.xmlschema-2.0.13/org.gvsig.xmlschema.lib/org.gvsig.xmlschema.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.xmlschema.lib.api.XMLSchemaLibrary |
|
2 |
|
org.gvsig.xmlschema/library/tags/org.gvsig.xmlschema-2.0.13/org.gvsig.xmlschema.lib/org.gvsig.xmlschema.lib.api/src/main/java/org/gvsig/xmlschema/lib/api/utils/SchemaTags.java | ||
---|---|---|
1 |
package org.gvsig.xmlschema.lib.api.utils; |
|
2 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
3 |
* |
|
4 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program 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 |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
19 |
* |
|
20 |
* For more information, contact: |
|
21 |
* |
|
22 |
* Generalitat Valenciana |
|
23 |
* Conselleria d'Infraestructures i Transport |
|
24 |
* Av. Blasco Ib??ez, 50 |
|
25 |
* 46010 VALENCIA |
|
26 |
* SPAIN |
|
27 |
* |
|
28 |
* +34 963862235 |
|
29 |
* gvsig@gva.es |
|
30 |
* www.gvsig.gva.es |
|
31 |
* |
|
32 |
* or |
|
33 |
* |
|
34 |
* IVER T.I. S.A |
|
35 |
* Salamanca 50 |
|
36 |
* 46005 Valencia |
|
37 |
* Spain |
|
38 |
* |
|
39 |
* +34 963163400 |
|
40 |
* dac@iver.es |
|
41 |
*/ |
|
42 |
/* CVS MESSAGES: |
|
43 |
* |
|
44 |
* $Id: SchemaTags.java 164 2007-07-02 10:00:46Z jorpiell $ |
|
45 |
* $Log$ |
|
46 |
* Revision 1.4 2007/07/02 09:57:35 jorpiell |
|
47 |
* The generated xsd schemas have to be valid |
|
48 |
* |
|
49 |
* Revision 1.3 2007/06/29 12:19:14 jorpiell |
|
50 |
* The schema validation is made independently of the concrete writer |
|
51 |
* |
|
52 |
* Revision 1.2 2007/06/28 13:04:33 jorpiell |
|
53 |
* The Qname has been updated to the 1.5 JVM machine. The schema validation is made in the GPEWriterHandlerImplementor class |
|
54 |
* |
|
55 |
* Revision 1.1 2007/06/14 16:15:03 jorpiell |
|
56 |
* builds to create the jars generated and add the schema code to the libGPEProject |
|
57 |
* |
|
58 |
* Revision 1.1 2007/06/14 13:50:07 jorpiell |
|
59 |
* The schema jar name has been changed |
|
60 |
* |
|
61 |
* Revision 1.3 2007/06/07 14:54:13 jorpiell |
|
62 |
* Add the schema support |
|
63 |
* |
|
64 |
* Revision 1.2 2007/05/30 12:25:48 jorpiell |
|
65 |
* Add the element collection |
|
66 |
* |
|
67 |
* Revision 1.1 2007/05/25 11:55:00 jorpiell |
|
68 |
* First update |
|
69 |
* |
|
70 |
* |
|
71 |
*/ |
|
72 |
/** |
|
73 |
* This class contains the xml schema constants |
|
74 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
75 |
*/ |
|
76 |
public class SchemaTags { |
|
77 |
public static final String SCHEMA_ROOT = "schema"; |
|
78 |
public static final String XLINK_NS_URI = "http://www.w3.org/1999/xlink"; |
|
79 |
public static final String XMLNS_NS_URI = "http://www.w3.org/2000/xmlns/"; |
|
80 |
public static final String XSD_NS_URI = "http://www.w3.org/2001/XMLSchema"; |
|
81 |
public static final String XS_NS_URI = "http://www.w3.org/2001/XMLSchema"; |
|
82 |
public static final String XSI_NS_URI = "http://www.w3.org/2001/XMLSchema-instance"; |
|
83 |
public static final String GML_NS_URI = "http://www.opengis.net/gml"; |
|
84 |
public static final String GML_NS = "gml"; |
|
85 |
public static final String XMLNS_NS = "xmlns"; |
|
86 |
public static final String XSD_NS = "xs"; |
|
87 |
public static final String XSI_NS = "xsi"; |
|
88 |
public static final String SCHEMA_LOCATION_ATTR_NAME = "schemaLocation"; |
|
89 |
public static final String XS_NS = "xs"; |
|
90 |
public static final String NAME = "name"; |
|
91 |
public static final String TYPE = "type"; |
|
92 |
public static final String TARGET_NAMESPACE = "targetNamespace"; |
|
93 |
public static final String SIMPLE_TYPE = "simpleType"; |
|
94 |
public static final String COMPLEX_TYPE = "complexType"; |
|
95 |
public static final String ELEMENT = "element"; |
|
96 |
public static final String COMPLEX_CONTENT = "complexContent"; |
|
97 |
public static final String SIMPLE_CONTENT = "simpleContent"; |
|
98 |
public static final String EXTENSION = "extension"; |
|
99 |
public static final String RESTRICTION = "restriction"; |
|
100 |
public static final String CHOICE = "choice"; |
|
101 |
public static final String GROUP = "group"; |
|
102 |
public static final String ALL = "all"; |
|
103 |
public static final String SEQUENCE = "sequence"; |
|
104 |
public static final String NILLABLE = "nillable"; |
|
105 |
public static final String TRUE = "true"; |
|
106 |
public static final String FALSE = "false"; |
|
107 |
public static final String MIN_OCCURS = "minOccurs"; |
|
108 |
public static final String MAX_OCCURS = "maxOccurs"; |
|
109 |
public static final String ELEMENTFORMDEFAULT = " elementFormDefault"; |
|
110 |
public static final String ATTRIBUTEFORMDEFAULT = "attributeFormDefault"; |
|
111 |
public static final String UNBOUNDED = "unbounded"; |
|
112 |
public static final String SUBSTITUTIONGROUP = "substitutionGroup"; |
|
113 |
public final static String REF = "ref"; |
|
114 |
public final static String BASE = "base"; |
|
115 |
public final static String TOTAL_DIGITS = "totalDigits"; |
|
116 |
public final static String FRACTION_DIGITS = "fractionDigits"; |
|
117 |
public final static String VALUE = "value"; |
|
118 |
public static final String VERSION = "version"; |
|
119 |
} |
|
0 | 120 |
org.gvsig.xmlschema/library/tags/org.gvsig.xmlschema-2.0.13/org.gvsig.xmlschema.lib/org.gvsig.xmlschema.lib.api/src/main/java/org/gvsig/xmlschema/lib/api/utils/TypeUtils.java | ||
---|---|---|
1 |
package org.gvsig.xmlschema.lib.api.utils; |
|
2 |
|
|
3 |
import org.gvsig.xmlschema.lib.api.som.IXSElementDeclaration; |
|
4 |
|
|
5 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
6 |
* |
|
7 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
8 |
* |
|
9 |
* This program is free software; you can redistribute it and/or |
|
10 |
* modify it under the terms of the GNU General Public License |
|
11 |
* as published by the Free Software Foundation; either version 2 |
|
12 |
* of the License, or (at your option) any later version. |
|
13 |
* |
|
14 |
* This program is distributed in the hope that it will be useful, |
|
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
17 |
* GNU General Public License for more details. |
|
18 |
* |
|
19 |
* You should have received a copy of the GNU General Public License |
|
20 |
* along with this program; if not, write to the Free Software |
|
21 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
22 |
* |
|
23 |
* For more information, contact: |
|
24 |
* |
|
25 |
* Generalitat Valenciana |
|
26 |
* Conselleria d'Infraestructures i Transport |
|
27 |
* Av. Blasco Ib??ez, 50 |
|
28 |
* 46010 VALENCIA |
|
29 |
* SPAIN |
|
30 |
* |
|
31 |
* +34 963862235 |
|
32 |
* gvsig@gva.es |
|
33 |
* www.gvsig.gva.es |
|
34 |
* |
|
35 |
* or |
|
36 |
* |
|
37 |
* IVER T.I. S.A |
|
38 |
* Salamanca 50 |
|
39 |
* 46005 Valencia |
|
40 |
* Spain |
|
41 |
* |
|
42 |
* +34 963163400 |
|
43 |
* dac@iver.es |
|
44 |
*/ |
|
45 |
/* CVS MESSAGES: |
|
46 |
* |
|
47 |
* $Id: TypeUtils.java 151 2007-06-14 16:15:05Z jorpiell $ |
|
48 |
* $Log$ |
|
49 |
* Revision 1.1 2007/06/14 16:15:03 jorpiell |
|
50 |
* builds to create the jars generated and add the schema code to the libGPEProject |
|
51 |
* |
|
52 |
* Revision 1.1 2007/06/14 13:50:07 jorpiell |
|
53 |
* The schema jar name has been changed |
|
54 |
* |
|
55 |
* Revision 1.1 2007/06/07 14:54:13 jorpiell |
|
56 |
* Add the schema support |
|
57 |
* |
|
58 |
* |
|
59 |
*/ |
|
60 |
/** |
|
61 |
* A class with some utils to manage the types |
|
62 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
63 |
*/ |
|
64 |
public class TypeUtils { |
|
65 |
public static final String STRING = "string"; |
|
66 |
public static final String INTEGER = "integer"; |
|
67 |
public static final String DOUBLE = "double"; |
|
68 |
public static final String LONG = "long"; |
|
69 |
public static final String BOOLEAN = "boolean"; |
|
70 |
public static final String DURATION = "duration"; |
|
71 |
public static final String DATETIME = "dateTime"; |
|
72 |
public static final String TIME = "time"; |
|
73 |
public static final String DATE = "date"; |
|
74 |
public static final String GYEARMONTH = "gYearMonth"; |
|
75 |
public static final String GYEAR = "gYear"; |
|
76 |
public static final String GMONTHDAY = "gMonthDay"; |
|
77 |
public static final String GDAY = "gDay"; |
|
78 |
public static final String GMONTH = "gMonth"; |
|
79 |
public static final String BASE64BINARY = "base64Binary"; |
|
80 |
public static final String HEXBINARY = "hexBinary"; |
|
81 |
public static final String ANYURI = "anyUri"; |
|
82 |
public static final String QNAME = "QName"; |
|
83 |
public static final String NOTATION = "NOTATION"; |
|
84 |
public static final String DECIMAL = "decimal"; |
|
85 |
public static final String NONPOSITIVEINTEGER = "nonPositiveInteger"; |
|
86 |
public static final String NONNEGATIVEINTEGER = "nonNegativeInteger"; |
|
87 |
public static final String NEGATIVEINTEGER = "negativeInteger"; |
|
88 |
public static final String POSITIVEINTEGER = "positiveInteger"; |
|
89 |
public static final String INT = "int"; |
|
90 |
public static final String INSIGNEDSHORT = "unsignedLong"; |
|
91 |
public static final String SHORT = "short"; |
|
92 |
public static final String UNSIGNEDINT = "unsignedInt"; |
|
93 |
public static final String BYTE = "byte"; |
|
94 |
public static final String UNSIGNEDSHORT = "unsignedShort"; |
|
95 |
public static final String UNSIGNEDBYTE = "unsignedByte"; |
|
96 |
public static final String NORMALIZEDSTRING = "normalizedString"; |
|
97 |
public static final String TOKEN = "token"; |
|
98 |
public static final String LANGUAGE = "language"; |
|
99 |
public static final String NAME = "Name"; |
|
100 |
public static final String NMTOKEN = "NMTOKEN"; |
|
101 |
public static final String NCNAME = "NCName"; |
|
102 |
public static final String ID = "ID"; |
|
103 |
public static final String IDREF = "IDREF"; |
|
104 |
public static final String ENTITY = "ENTITY"; |
|
105 |
|
|
106 |
/** |
|
107 |
* Return the XML schema simple type from a class |
|
108 |
* @param clazz |
|
109 |
* Clazz to compare the name |
|
110 |
* @return |
|
111 |
* Xml schema simple type |
|
112 |
*/ |
|
113 |
public static String getType(Class clazz){ |
|
114 |
if (clazz.getName().compareTo(String.class.getName()) == 0){ |
|
115 |
return STRING; |
|
116 |
}else if (clazz.getName().compareTo(Integer.class.getName()) == 0){ |
|
117 |
return INTEGER; |
|
118 |
}else if (clazz.getName().compareTo(Double.class.getName()) == 0){ |
|
119 |
return DOUBLE; |
|
120 |
}else if (clazz.getName().compareTo(Long.class.getName()) == 0){ |
|
121 |
return LONG; |
|
122 |
}else if (clazz.getName().compareTo(Boolean.class.getName()) == 0){ |
|
123 |
return BOOLEAN; |
|
124 |
} |
|
125 |
return STRING; |
|
126 |
} |
|
127 |
|
|
128 |
/** |
|
129 |
* Return the XML schema simple type from a class. The |
|
130 |
* name contains the Xlink namespace |
|
131 |
* @param clazz |
|
132 |
* Clazz to compare the name |
|
133 |
* @return |
|
134 |
* Xml schema simple type with the xlink prefix |
|
135 |
*/ |
|
136 |
public static String getXSType(Class clazz){ |
|
137 |
return SchemaTags.XS_NS + ":" + getType(clazz); |
|
138 |
} |
|
139 |
|
|
140 |
public static Object getValue(IXSElementDeclaration element, String value) { |
|
141 |
if ((element == null) || (element.getTypeName() == null)){ |
|
142 |
return value; |
|
143 |
} |
|
144 |
String typeName = element.getTypeName(); |
|
145 |
typeName = typeName.substring(typeName.indexOf(":") + 1,typeName.length()); |
|
146 |
if (typeName.compareTo(INTEGER) == 0){ |
|
147 |
return new Integer(Integer.parseInt(value)); |
|
148 |
}else if (typeName.compareTo(BOOLEAN) == 0){ |
|
149 |
return new Boolean(Boolean.getBoolean(value)); |
|
150 |
} |
|
151 |
return value; |
|
152 |
} |
|
153 |
|
|
154 |
|
|
155 |
} |
|
0 | 156 |
org.gvsig.xmlschema/library/tags/org.gvsig.xmlschema-2.0.13/org.gvsig.xmlschema.lib/org.gvsig.xmlschema.lib.api/src/main/java/org/gvsig/xmlschema/lib/api/utils/SchemaObjectsMapping.java | ||
---|---|---|
1 |
package org.gvsig.xmlschema.lib.api.utils; |
|
2 |
|
|
3 |
import java.util.Hashtable; |
|
4 |
import java.util.Map; |
|
5 |
import java.util.Set; |
|
6 |
|
|
7 |
import org.gvsig.xmlschema.lib.api.som.IXSElement; |
|
8 |
import org.gvsig.xmlschema.lib.api.som.IXSNode; |
|
9 |
import org.gvsig.xmlschema.lib.api.som.IXSSchema; |
|
10 |
|
|
11 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
12 |
* |
|
13 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
14 |
* |
|
15 |
* This program is free software; you can redistribute it and/or |
|
16 |
* modify it under the terms of the GNU General Public License |
|
17 |
* as published by the Free Software Foundation; either version 2 |
|
18 |
* of the License, or (at your option) any later version. |
|
19 |
* |
|
20 |
* This program is distributed in the hope that it will be useful, |
|
21 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
22 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
23 |
* GNU General Public License for more details. |
|
24 |
* |
|
25 |
* You should have received a copy of the GNU General Public License |
|
26 |
* along with this program; if not, write to the Free Software |
|
27 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
28 |
* |
|
29 |
* For more information, contact: |
|
30 |
* |
|
31 |
* Generalitat Valenciana |
|
32 |
* Conselleria d'Infraestructures i Transport |
|
33 |
* Av. Blasco Ib??ez, 50 |
|
34 |
* 46010 VALENCIA |
|
35 |
* SPAIN |
|
36 |
* |
|
37 |
* +34 963862235 |
|
38 |
* gvsig@gva.es |
|
39 |
* www.gvsig.gva.es |
|
40 |
* |
|
41 |
* or |
|
42 |
* |
|
43 |
* IVER T.I. S.A |
|
44 |
* Salamanca 50 |
|
45 |
* 46005 Valencia |
|
46 |
* Spain |
|
47 |
* |
|
48 |
* +34 963163400 |
|
49 |
* dac@iver.es |
|
50 |
*/ |
|
51 |
/* CVS MESSAGES: |
|
52 |
* |
|
53 |
* $Id: SchemaObjectsMapping.java 157 2007-06-22 12:22:53Z jorpiell $ |
|
54 |
* $Log$ |
|
55 |
* Revision 1.2 2007/06/22 12:20:48 jorpiell |
|
56 |
* The typeNotFoundException has been deleted. It never was thrown |
|
57 |
* |
|
58 |
* Revision 1.1 2007/06/14 16:15:03 jorpiell |
|
59 |
* builds to create the jars generated and add the schema code to the libGPEProject |
|
60 |
* |
|
61 |
* Revision 1.1 2007/06/14 13:50:07 jorpiell |
|
62 |
* The schema jar name has been changed |
|
63 |
* |
|
64 |
* Revision 1.1 2007/06/07 14:54:13 jorpiell |
|
65 |
* Add the schema support |
|
66 |
* |
|
67 |
* Revision 1.1 2007/05/30 12:25:48 jorpiell |
|
68 |
* Add the element collection |
|
69 |
* |
|
70 |
* |
|
71 |
*/ |
|
72 |
/** |
|
73 |
* A mapping between a xml node name and a class that |
|
74 |
* implements it. |
|
75 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
76 |
*/ |
|
77 |
public class SchemaObjectsMapping { |
|
78 |
private Map types = null; |
|
79 |
private IXSSchema schema = null; |
|
80 |
|
|
81 |
public SchemaObjectsMapping(IXSSchema schema) { |
|
82 |
super(); |
|
83 |
this.schema = schema; |
|
84 |
types = new Hashtable(); |
|
85 |
} |
|
86 |
|
|
87 |
/** |
|
88 |
* @return the supported types |
|
89 |
*/ |
|
90 |
public Set getTypes(){ |
|
91 |
return types.keySet(); |
|
92 |
} |
|
93 |
|
|
94 |
/** |
|
95 |
* Add a new type and creates the object that will be used to |
|
96 |
* envolve the element |
|
97 |
* @param type |
|
98 |
* Type name that will be found in the XML file |
|
99 |
* @param clazz |
|
100 |
* Class used to create the object that envolves the element |
|
101 |
* @throws TypeNotFoundException |
|
102 |
*/ |
|
103 |
public void addType(String type, Class clazz){ |
|
104 |
Class[] parameterTypes = {IXSSchema.class}; |
|
105 |
Object[] initargs = {schema}; |
|
106 |
IXSNode node = null; |
|
107 |
try { |
|
108 |
node = (IXSNode)clazz.getConstructor(parameterTypes).newInstance(initargs); |
|
109 |
} catch (Exception e){ |
|
110 |
e.printStackTrace(); |
|
111 |
} |
|
112 |
types.put(type, node); |
|
113 |
} |
|
114 |
|
|
115 |
/** |
|
116 |
* Returns the node |
|
117 |
* @param type |
|
118 |
* Type name |
|
119 |
* @return |
|
120 |
* A node with a element inside |
|
121 |
*/ |
|
122 |
public IXSNode getNode(String type, IXSElement element){ |
|
123 |
Object obj = types.get(type); |
|
124 |
if (obj != null){ |
|
125 |
IXSNode node = (IXSNode)obj; |
|
126 |
node.setElement(element); |
|
127 |
return node; |
|
128 |
} |
|
129 |
return null; |
|
130 |
} |
|
131 |
} |
|
0 | 132 |
org.gvsig.xmlschema/library/tags/org.gvsig.xmlschema-2.0.13/org.gvsig.xmlschema.lib/org.gvsig.xmlschema.lib.api/src/main/java/org/gvsig/xmlschema/lib/api/exceptions/SimpleTypeCreationException.java | ||
---|---|---|
1 |
package org.gvsig.xmlschema.lib.api.exceptions; |
|
2 |
|
|
3 |
import java.util.Hashtable; |
|
4 |
import java.util.Map; |
|
5 |
|
|
6 |
import org.gvsig.tools.exception.BaseException; |
|
7 |
|
|
8 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
9 |
* |
|
10 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
11 |
* |
|
12 |
* This program is free software; you can redistribute it and/or |
|
13 |
* modify it under the terms of the GNU General Public License |
|
14 |
* as published by the Free Software Foundation; either version 2 |
|
15 |
* of the License, or (at your option) any later version. |
|
16 |
* |
|
17 |
* This program is distributed in the hope that it will be useful, |
|
18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
20 |
* GNU General Public License for more details. |
|
21 |
* |
|
22 |
* You should have received a copy of the GNU General Public License |
|
23 |
* along with this program; if not, write to the Free Software |
|
24 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
25 |
* |
|
26 |
* For more information, contact: |
|
27 |
* |
|
28 |
* Generalitat Valenciana |
|
29 |
* Conselleria d'Infraestructures i Transport |
|
30 |
* Av. Blasco Ib??ez, 50 |
|
31 |
* 46010 VALENCIA |
|
32 |
* SPAIN |
|
33 |
* |
|
34 |
* +34 963862235 |
|
35 |
* gvsig@gva.es |
|
36 |
* www.gvsig.gva.es |
|
37 |
* |
|
38 |
* or |
|
39 |
* |
|
40 |
* IVER T.I. S.A |
|
41 |
* Salamanca 50 |
|
42 |
* 46005 Valencia |
|
43 |
* Spain |
|
44 |
* |
|
45 |
* +34 963163400 |
|
46 |
* dac@iver.es |
|
47 |
*/ |
|
48 |
/* CVS MESSAGES: |
|
49 |
* |
|
50 |
* $Id: SimpleTypeCreationException.java 151 2007-06-14 16:15:05Z jorpiell $ |
|
51 |
* $Log$ |
|
52 |
* Revision 1.1 2007/06/14 16:15:03 jorpiell |
|
53 |
* builds to create the jars generated and add the schema code to the libGPEProject |
|
54 |
* |
|
55 |
* Revision 1.1 2007/06/14 13:50:07 jorpiell |
|
56 |
* The schema jar name has been changed |
|
57 |
* |
|
58 |
* Revision 1.1 2007/06/07 14:54:13 jorpiell |
|
59 |
* Add the schema support |
|
60 |
* |
|
61 |
* |
|
62 |
*/ |
|
63 |
/** |
|
64 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
65 |
*/ |
|
66 |
public class SimpleTypeCreationException extends BaseException{ |
|
67 |
private static final long serialVersionUID = 4408820045280755887L; |
|
68 |
|
|
69 |
public SimpleTypeCreationException(Throwable exception) { |
|
70 |
init(); |
|
71 |
initCause(exception); |
|
72 |
} |
|
73 |
|
|
74 |
private void init() { |
|
75 |
messageKey = "error_gpe_schema_simpleType_creation"; |
|
76 |
formatString = "Error creating the xs simple type"; |
|
77 |
code = serialVersionUID; |
|
78 |
} |
|
79 |
|
|
80 |
/* |
|
81 |
* (non-Javadoc) |
|
82 |
* @see org.gvsig.tools.exception.BaseException#values() |
|
83 |
*/ |
|
84 |
protected Map values() { |
|
85 |
Hashtable params = new Hashtable(); |
|
86 |
return params; |
|
87 |
} |
|
88 |
} |
|
0 | 89 |
org.gvsig.xmlschema/library/tags/org.gvsig.xmlschema-2.0.13/org.gvsig.xmlschema.lib/org.gvsig.xmlschema.lib.api/src/main/java/org/gvsig/xmlschema/lib/api/exceptions/SchemaCreationException.java | ||
---|---|---|
1 |
package org.gvsig.xmlschema.lib.api.exceptions; |
|
2 |
|
|
3 |
import java.util.Hashtable; |
|
4 |
import java.util.Map; |
|
5 |
|
|
6 |
import org.gvsig.tools.exception.BaseException; |
|
7 |
|
|
8 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
9 |
* |
|
10 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
11 |
* |
|
12 |
* This program is free software; you can redistribute it and/or |
|
13 |
* modify it under the terms of the GNU General Public License |
|
14 |
* as published by the Free Software Foundation; either version 2 |
|
15 |
* of the License, or (at your option) any later version. |
|
16 |
* |
|
17 |
* This program is distributed in the hope that it will be useful, |
|
18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
20 |
* GNU General Public License for more details. |
|
21 |
* |
|
22 |
* You should have received a copy of the GNU General Public License |
|
23 |
* along with this program; if not, write to the Free Software |
|
24 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
25 |
* |
|
26 |
* For more information, contact: |
|
27 |
* |
|
28 |
* Generalitat Valenciana |
|
29 |
* Conselleria d'Infraestructures i Transport |
|
30 |
* Av. Blasco Ib??ez, 50 |
|
31 |
* 46010 VALENCIA |
|
32 |
* SPAIN |
|
33 |
* |
|
34 |
* +34 963862235 |
|
35 |
* gvsig@gva.es |
|
36 |
* www.gvsig.gva.es |
|
37 |
* |
|
38 |
* or |
|
39 |
* |
|
40 |
* IVER T.I. S.A |
|
41 |
* Salamanca 50 |
|
42 |
* 46005 Valencia |
|
43 |
* Spain |
|
44 |
* |
|
45 |
* +34 963163400 |
|
46 |
* dac@iver.es |
|
47 |
*/ |
|
48 |
/* CVS MESSAGES: |
|
49 |
* |
|
50 |
* $Id: SchemaCreationException.java 151 2007-06-14 16:15:05Z jorpiell $ |
|
51 |
* $Log$ |
|
52 |
* Revision 1.1 2007/06/14 16:15:03 jorpiell |
|
53 |
* builds to create the jars generated and add the schema code to the libGPEProject |
|
54 |
* |
|
55 |
* Revision 1.1 2007/06/14 13:50:07 jorpiell |
|
56 |
* The schema jar name has been changed |
|
57 |
* |
|
58 |
* Revision 1.1 2007/06/07 14:54:13 jorpiell |
|
59 |
* Add the schema support |
|
60 |
* |
|
61 |
* Revision 1.2 2007/05/30 12:25:48 jorpiell |
|
62 |
* Add the element collection |
|
63 |
* |
|
64 |
* Revision 1.1 2007/05/28 12:38:03 jorpiell |
|
65 |
* Some bugs fixed |
|
66 |
* |
|
67 |
* |
|
68 |
*/ |
|
69 |
/** |
|
70 |
* Throwed when is impossible to create a new schema |
|
71 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
72 |
*/ |
|
73 |
public class SchemaCreationException extends BaseException{ |
|
74 |
private static final long serialVersionUID = 4287203176574644169L; |
|
75 |
|
|
76 |
public SchemaCreationException(Throwable exception) { |
|
77 |
init(); |
|
78 |
initCause(exception); |
|
79 |
} |
|
80 |
|
|
81 |
private void init() { |
|
82 |
messageKey = "error_gpe_schema_creation"; |
|
83 |
formatString = "Error creating the xml schema"; |
|
84 |
code = serialVersionUID; |
|
85 |
} |
|
86 |
|
|
87 |
/* |
|
88 |
* (non-Javadoc) |
|
89 |
* @see org.gvsig.tools.exception.BaseException#values() |
|
90 |
*/ |
|
91 |
protected Map values() { |
|
92 |
Hashtable params = new Hashtable(); |
|
93 |
return params; |
|
94 |
} |
|
95 |
} |
|
0 | 96 |
org.gvsig.xmlschema/library/tags/org.gvsig.xmlschema-2.0.13/org.gvsig.xmlschema.lib/org.gvsig.xmlschema.lib.api/src/main/java/org/gvsig/xmlschema/lib/api/exceptions/NotDownloadFileException.java | ||
---|---|---|
1 |
package org.gvsig.xmlschema.lib.api.exceptions; |
|
2 |
|
|
3 |
import java.util.Hashtable; |
|
4 |
import java.util.Map; |
|
5 |
|
|
6 |
import org.gvsig.tools.exception.BaseException; |
|
7 |
|
|
8 |
|
|
9 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
10 |
* |
|
11 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
12 |
* |
|
13 |
* This program is free software; you can redistribute it and/or |
|
14 |
* modify it under the terms of the GNU General Public License |
|
15 |
* as published by the Free Software Foundation; either version 2 |
|
16 |
* of the License, or (at your option) any later version. |
|
17 |
* |
|
18 |
* This program is distributed in the hope that it will be useful, |
|
19 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
20 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
21 |
* GNU General Public License for more details. |
|
22 |
* |
|
23 |
* You should have received a copy of the GNU General Public License |
|
24 |
* along with this program; if not, write to the Free Software |
|
25 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
26 |
* |
|
27 |
* For more information, contact: |
|
28 |
* |
|
29 |
* Generalitat Valenciana |
|
30 |
* Conselleria d'Infraestructures i Transport |
|
31 |
* Av. Blasco Ib??ez, 50 |
|
32 |
* 46010 VALENCIA |
|
33 |
* SPAIN |
|
34 |
* |
|
35 |
* +34 963862235 |
|
36 |
* gvsig@gva.es |
|
37 |
* www.gvsig.gva.es |
|
38 |
* |
|
39 |
* or |
|
40 |
* |
|
41 |
* IVER T.I. S.A |
|
42 |
* Salamanca 50 |
|
43 |
* 46005 Valencia |
|
44 |
* Spain |
|
45 |
* |
|
46 |
* +34 963163400 |
|
47 |
* dac@iver.es |
|
48 |
*/ |
|
49 |
/* CVS MESSAGES: |
|
50 |
* |
|
51 |
* $Id: NotDownloadFileException.java 151 2007-06-14 16:15:05Z jorpiell $ |
|
52 |
* $Log$ |
|
53 |
* Revision 1.1 2007/06/14 16:15:03 jorpiell |
|
54 |
* builds to create the jars generated and add the schema code to the libGPEProject |
|
55 |
* |
|
56 |
* Revision 1.1 2007/06/14 13:50:07 jorpiell |
|
57 |
* The schema jar name has been changed |
|
58 |
* |
|
59 |
* Revision 1.1 2007/06/07 14:54:13 jorpiell |
|
60 |
* Add the schema support |
|
61 |
* |
|
62 |
* |
|
63 |
*/ |
|
64 |
/** |
|
65 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
66 |
*/ |
|
67 |
public class NotDownloadFileException extends BaseException{ |
|
68 |
private static final long serialVersionUID = 4924434630213400792L; |
|
69 |
|
|
70 |
public NotDownloadFileException(Throwable exception) { |
|
71 |
init(); |
|
72 |
initCause(exception); |
|
73 |
} |
|
74 |
|
|
75 |
private void init() { |
|
76 |
messageKey = "error_gpe_download"; |
|
77 |
formatString = "Error downloading the xml schema"; |
|
78 |
code = serialVersionUID; |
|
79 |
} |
|
80 |
|
|
81 |
/* |
|
82 |
* (non-Javadoc) |
|
83 |
* @see org.gvsig.tools.exception.BaseException#values() |
|
84 |
*/ |
|
85 |
protected Map values() { |
|
86 |
Hashtable params = new Hashtable(); |
|
87 |
return params; |
|
88 |
} |
|
89 |
} |
|
90 |
|
|
0 | 91 |
org.gvsig.xmlschema/library/tags/org.gvsig.xmlschema-2.0.13/org.gvsig.xmlschema.lib/org.gvsig.xmlschema.lib.api/src/main/java/org/gvsig/xmlschema/lib/api/exceptions/SchemaWrittingException.java | ||
---|---|---|
1 |
package org.gvsig.xmlschema.lib.api.exceptions; |
|
2 |
|
|
3 |
import java.util.Hashtable; |
|
4 |
import java.util.Map; |
|
5 |
|
|
6 |
import org.gvsig.tools.exception.BaseException; |
|
7 |
|
|
8 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
9 |
* |
|
10 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
11 |
* |
|
12 |
* This program is free software; you can redistribute it and/or |
|
13 |
* modify it under the terms of the GNU General Public License |
|
14 |
* as published by the Free Software Foundation; either version 2 |
|
15 |
* of the License, or (at your option) any later version. |
|
16 |
* |
|
17 |
* This program is distributed in the hope that it will be useful, |
|
18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
20 |
* GNU General Public License for more details. |
|
21 |
* |
|
22 |
* You should have received a copy of the GNU General Public License |
|
23 |
* along with this program; if not, write to the Free Software |
|
24 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
25 |
* |
|
26 |
* For more information, contact: |
|
27 |
* |
|
28 |
* Generalitat Valenciana |
|
29 |
* Conselleria d'Infraestructures i Transport |
|
30 |
* Av. Blasco Ib??ez, 50 |
|
31 |
* 46010 VALENCIA |
|
32 |
* SPAIN |
|
33 |
* |
|
34 |
* +34 963862235 |
|
35 |
* gvsig@gva.es |
|
36 |
* www.gvsig.gva.es |
|
37 |
* |
|
38 |
* or |
|
39 |
* |
|
40 |
* IVER T.I. S.A |
|
41 |
* Salamanca 50 |
|
42 |
* 46005 Valencia |
|
43 |
* Spain |
|
44 |
* |
|
45 |
* +34 963163400 |
|
46 |
* dac@iver.es |
|
47 |
*/ |
|
48 |
/* CVS MESSAGES: |
|
49 |
* |
|
50 |
* $Id: SchemaWrittingException.java 151 2007-06-14 16:15:05Z jorpiell $ |
|
51 |
* $Log$ |
|
52 |
* Revision 1.1 2007/06/14 16:15:03 jorpiell |
|
53 |
* builds to create the jars generated and add the schema code to the libGPEProject |
|
54 |
* |
|
55 |
* Revision 1.1 2007/06/14 13:50:07 jorpiell |
|
56 |
* The schema jar name has been changed |
|
57 |
* |
|
58 |
* Revision 1.1 2007/06/07 14:54:13 jorpiell |
|
59 |
* Add the schema support |
|
60 |
* |
|
61 |
* Revision 1.2 2007/05/30 12:25:48 jorpiell |
|
62 |
* Add the element collection |
|
63 |
* |
|
64 |
* Revision 1.1 2007/05/28 12:38:03 jorpiell |
|
65 |
* Some bugs fixed |
|
66 |
* |
|
67 |
* |
|
68 |
*/ |
|
69 |
/** |
|
70 |
* Throwed if there is a problem writting the schema in |
|
71 |
* the outputstream |
|
72 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
73 |
*/ |
|
74 |
public class SchemaWrittingException extends BaseException{ |
|
75 |
private static final long serialVersionUID = 2206394432213668150L; |
|
76 |
|
|
77 |
public SchemaWrittingException(Throwable exception) { |
|
78 |
init(); |
|
79 |
initCause(exception); |
|
80 |
} |
|
81 |
|
|
82 |
private void init() { |
|
83 |
messageKey = "error_gpe_schema_writting"; |
|
84 |
formatString = "Error writting the schema"; |
|
85 |
code = serialVersionUID; |
|
86 |
} |
|
87 |
|
|
88 |
/* |
|
89 |
* (non-Javadoc) |
|
90 |
* @see org.gvsig.tools.exception.BaseException#values() |
|
91 |
*/ |
|
92 |
protected Map values() { |
|
93 |
Hashtable params = new Hashtable(); |
|
94 |
return params; |
|
95 |
} |
|
96 |
} |
|
0 | 97 |
org.gvsig.xmlschema/library/tags/org.gvsig.xmlschema-2.0.13/org.gvsig.xmlschema.lib/org.gvsig.xmlschema.lib.api/src/main/java/org/gvsig/xmlschema/lib/api/XMLSchemaLocator.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program 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 |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 {Iver T.I.} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.xmlschema.lib.api; |
|
29 |
|
|
30 |
import org.gvsig.tools.locator.AbstractLocator; |
|
31 |
import org.gvsig.tools.locator.Locator; |
|
32 |
import org.gvsig.tools.locator.LocatorException; |
|
33 |
|
|
34 |
/** |
|
35 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a> |
|
36 |
*/ |
|
37 |
public class XMLSchemaLocator extends AbstractLocator { |
|
38 |
private static final String LOCATOR_NAME = "XMLSchemaLocator"; |
|
39 |
/** |
|
40 |
* XMLSchemaManager name used by the locator to access the instance |
|
41 |
*/ |
|
42 |
public static final String XMLSCHEMA_MANAGER_NAME = "XMLSchemaManager"; |
|
43 |
private static final String XMLSCHEMA_MANAGER_DESCRIPTION = "XMLSchemaManager of gvSIG"; |
|
44 |
|
|
45 |
|
|
46 |
/** |
|
47 |
* Unique instance. |
|
48 |
*/ |
|
49 |
private static final XMLSchemaLocator instance = new XMLSchemaLocator(); |
|
50 |
|
|
51 |
/* (non-Javadoc) |
|
52 |
* @see org.gvsig.tools.locator.Locator#getLocatorName() |
|
53 |
*/ |
|
54 |
public String getLocatorName() { |
|
55 |
return LOCATOR_NAME; |
|
56 |
} |
|
57 |
|
|
58 |
/** |
|
59 |
* Return the singleton instance. |
|
60 |
* |
|
61 |
* @return the singleton instance |
|
62 |
*/ |
|
63 |
public static XMLSchemaLocator getInstance() { |
|
64 |
return instance; |
|
65 |
} |
|
66 |
|
|
67 |
/** |
|
68 |
* Return a reference to {@link XMLSchemaManager}. |
|
69 |
* |
|
70 |
* @return a reference to XMLSchemaManager |
|
71 |
* @throws LocatorException |
|
72 |
* if there is no access to the class or the class cannot be |
|
73 |
* instantiated |
|
74 |
* @see Locator#get(String) |
|
75 |
*/ |
|
76 |
public static XMLSchemaManager getXMLSchemaManager() throws LocatorException { |
|
77 |
return (XMLSchemaManager) getInstance().get(XMLSCHEMA_MANAGER_NAME); |
|
78 |
} |
|
79 |
|
|
80 |
/** |
|
81 |
* Registers the Class implementing the {@link XMLSchemaManager} interface. |
|
82 |
* |
|
83 |
* @param clazz |
|
84 |
* implementing the XMLSchemaManager interface |
|
85 |
*/ |
|
86 |
public static void registerXMLSchemaManager(Class clazz) { |
|
87 |
getInstance().register(XMLSCHEMA_MANAGER_NAME, |
|
88 |
XMLSCHEMA_MANAGER_DESCRIPTION, |
|
89 |
clazz); |
|
90 |
} |
|
91 |
} |
|
92 |
|
|
0 | 93 |
org.gvsig.xmlschema/library/tags/org.gvsig.xmlschema-2.0.13/org.gvsig.xmlschema.lib/org.gvsig.xmlschema.lib.api/src/main/java/org/gvsig/xmlschema/lib/api/XMLSchemaLibrary.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program 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 |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 {Iver T.I.} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.xmlschema.lib.api; |
|
29 |
|
|
30 |
import org.gvsig.tools.library.AbstractLibrary; |
|
31 |
import org.gvsig.tools.library.LibraryException; |
|
32 |
|
|
33 |
/** |
|
34 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a> |
|
35 |
*/ |
|
36 |
public class XMLSchemaLibrary extends AbstractLibrary { |
|
37 |
|
|
38 |
public void doRegistration() { |
|
39 |
registerAsAPI(XMLSchemaLibrary.class); |
|
40 |
} |
|
41 |
|
|
42 |
protected void doInitialize() throws LibraryException { |
|
43 |
// Nothing to do |
|
44 |
} |
|
45 |
|
|
46 |
protected void doPostInitialize() throws LibraryException { |
|
47 |
// Nothing to do |
|
48 |
} |
|
49 |
} |
|
50 |
|
|
0 | 51 |
org.gvsig.xmlschema/library/tags/org.gvsig.xmlschema-2.0.13/org.gvsig.xmlschema.lib/org.gvsig.xmlschema.lib.api/src/main/java/org/gvsig/xmlschema/lib/api/warnings/SchemaLocationWarning.java | ||
---|---|---|
1 |
package org.gvsig.xmlschema.lib.api.warnings; |
|
2 |
|
|
3 |
import java.util.Hashtable; |
|
4 |
import java.util.Map; |
|
5 |
|
|
6 |
import org.gvsig.tools.exception.BaseException; |
|
7 |
|
|
8 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
9 |
* |
|
10 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
11 |
* |
|
12 |
* This program is free software; you can redistribute it and/or |
|
13 |
* modify it under the terms of the GNU General Public License |
|
14 |
* as published by the Free Software Foundation; either version 2 |
|
15 |
* of the License, or (at your option) any later version. |
|
16 |
* |
|
17 |
* This program is distributed in the hope that it will be useful, |
|
18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
20 |
* GNU General Public License for more details. |
|
21 |
* |
|
22 |
* You should have received a copy of the GNU General Public License |
|
23 |
* along with this program; if not, write to the Free Software |
|
24 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
25 |
* |
|
26 |
* For more information, contact: |
|
27 |
* |
|
28 |
* Generalitat Valenciana |
|
29 |
* Conselleria d'Infraestructures i Transport |
|
30 |
* Av. Blasco Ib??ez, 50 |
|
31 |
* 46010 VALENCIA |
|
32 |
* SPAIN |
|
33 |
* |
|
34 |
* +34 963862235 |
|
35 |
* gvsig@gva.es |
|
36 |
* www.gvsig.gva.es |
|
37 |
* |
|
38 |
* or |
|
39 |
* |
|
40 |
* IVER T.I. S.A |
|
41 |
* Salamanca 50 |
|
42 |
* 46005 Valencia |
|
43 |
* Spain |
|
44 |
* |
|
45 |
* +34 963163400 |
|
46 |
* dac@iver.es |
|
47 |
*/ |
|
48 |
/* CVS MESSAGES: |
|
49 |
* |
|
50 |
* $Id: SchemaLocationWarning.java 151 2007-06-14 16:15:05Z jorpiell $ |
|
51 |
* $Log$ |
|
52 |
* Revision 1.1 2007/06/14 16:15:03 jorpiell |
|
53 |
* builds to create the jars generated and add the schema code to the libGPEProject |
|
54 |
* |
|
55 |
* Revision 1.1 2007/06/14 13:50:07 jorpiell |
|
56 |
* The schema jar name has been changed |
|
57 |
* |
|
58 |
* |
|
59 |
*/ |
|
60 |
/** |
|
61 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
62 |
*/ |
|
63 |
public class SchemaLocationWarning extends BaseException{ |
|
64 |
private static final long serialVersionUID = -7232629060306401806L; |
|
65 |
private String schemaLocation = null; |
|
66 |
|
|
67 |
public SchemaLocationWarning(String schemaLocation, Throwable exception){ |
|
68 |
this.schemaLocation = schemaLocation; |
|
69 |
init(); |
|
70 |
initCause(exception); |
|
71 |
} |
|
72 |
|
|
73 |
private void init() { |
|
74 |
messageKey = "warning_gpe_schema_location"; |
|
75 |
formatString = "Schema Location %(schemaLocation) is not found"; |
|
76 |
code = serialVersionUID; |
|
77 |
} |
|
78 |
|
|
79 |
/* |
|
80 |
* (non-Javadoc) |
|
81 |
* @see org.gvsig.tools.exception.BaseException#values() |
|
82 |
*/ |
|
83 |
protected Map values() { |
|
84 |
Hashtable hash = new Hashtable(); |
|
85 |
hash.put("schemaLocation", schemaLocation); |
|
86 |
return hash; |
|
87 |
} |
|
88 |
|
|
89 |
} |
|
0 | 90 |
org.gvsig.xmlschema/library/tags/org.gvsig.xmlschema-2.0.13/org.gvsig.xmlschema.lib/org.gvsig.xmlschema.lib.api/src/main/java/org/gvsig/xmlschema/lib/api/XMLSchemaManager.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program 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 |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 {Iver T.I.} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.xmlschema.lib.api; |
|
29 |
|
|
30 |
import java.io.InputStream; |
|
31 |
|
|
32 |
import org.gvsig.xmlschema.lib.api.exceptions.SchemaCreationException; |
|
33 |
import org.gvsig.xmlschema.lib.api.som.IXSSchema; |
|
34 |
import org.gvsig.xmlschema.lib.api.som.IXSTypeDefinition; |
|
35 |
|
|
36 |
/** |
|
37 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a> |
|
38 |
*/ |
|
39 |
public interface XMLSchemaManager{ |
|
40 |
public final static int GEOMETRY = 0; |
|
41 |
public final static int POINT = 1; |
|
42 |
public final static int LINESTRING = 2; |
|
43 |
public final static int POLYGON = 3; |
|
44 |
public final static int SOLID = 4; |
|
45 |
public final static int MULTIGEOMETRY = 6; |
|
46 |
public final static int MULTIPOINT = 7; |
|
47 |
public final static int MULTILINESTRING = 8; |
|
48 |
public final static int MULTIPOLYGON = 9; |
|
49 |
public final static int MULTISOLID = 10; |
|
50 |
|
|
51 |
public IXSSchema createXSSchema(String providerName, String namespaceURI, String namespacePrefix) throws SchemaCreationException; |
|
52 |
|
|
53 |
public IXSSchema parse(String providerName, InputStream is) throws SchemaCreationException; |
|
54 |
|
|
55 |
public void registerFormat(String mimeType, String format); |
|
56 |
|
|
57 |
public String getFormat(String mimeType); |
|
58 |
|
|
59 |
public Object getApplicationDataTypeByFormat(String format, Object parserDataType); |
|
60 |
|
|
61 |
public Object getParserDataTypeByFormat(String format, Object applicationDataType); |
|
62 |
|
|
63 |
public Object getApplicationDataTypeByMimeType(String mimeType, Object parserDataType); |
|
64 |
|
|
65 |
public Object getParserDataTypeByMimeType(String mimeType, Object applicationDataType); |
|
66 |
|
|
67 |
public Object getApplicationGeometryTypeByFormat(String format, Object parserGeometryType); |
|
68 |
|
|
69 |
public Object getParserGeometryTypeByFormat(String format, Object applicationGeometry); |
|
70 |
|
|
71 |
public Object getApplicationGeometryTypeByMimeType(String mimeType, Object parserGeometryType); |
|
72 |
|
|
73 |
public Object getParserGeometryTypeByMimeType(String mimeType, Object applicationGeometry); |
|
74 |
|
|
75 |
public void addParserGeometryType(String format, Object parserGeometryType, int gpeGeometryType); |
|
76 |
|
|
77 |
public void addParserDataType(String format, Object parserDataType, int gpeDataType); |
|
78 |
|
|
79 |
public void addParserDataType(Object parserDataType, int gpeDataType); |
|
80 |
|
|
81 |
public void registerAppGeometryType(Object appGeometrytype, int gpeGeometryType); |
|
82 |
|
|
83 |
public void registerAppDataType(Object appDataType, int gpeDataType); |
|
84 |
|
|
85 |
public void registerAppGeometryType(int appGeometrytype, int gpeGeometryType); |
|
86 |
|
|
87 |
public void registerAppDataType(int appDataType, int gpeDataType); |
|
88 |
|
|
89 |
public IXSTypeDefinition getTypeDefinition(String typeName); |
|
90 |
|
|
91 |
public IXSTypeDefinition getTypeDefinition(String format, String typeName); |
|
92 |
} |
|
93 |
|
|
94 |
|
|
0 | 95 |
org.gvsig.xmlschema/library/tags/org.gvsig.xmlschema-2.0.13/org.gvsig.xmlschema.lib/org.gvsig.xmlschema.lib.api/src/main/java/org/gvsig/xmlschema/lib/api/som/IXSExtension.java | ||
---|---|---|
1 |
package org.gvsig.xmlschema.lib.api.som; |
|
2 |
|
|
3 |
|
|
4 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
5 |
* |
|
6 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
7 |
* |
|
8 |
* This program is free software; you can redistribute it and/or |
|
9 |
* modify it under the terms of the GNU General Public License |
|
10 |
* as published by the Free Software Foundation; either version 2 |
|
11 |
* of the License, or (at your option) any later version. |
|
12 |
* |
|
13 |
* This program is distributed in the hope that it will be useful, |
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
* GNU General Public License for more details. |
|
17 |
* |
|
18 |
* You should have received a copy of the GNU General Public License |
|
19 |
* along with this program; if not, write to the Free Software |
|
20 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
21 |
* |
|
22 |
* For more information, contact: |
|
23 |
* |
|
24 |
* Generalitat Valenciana |
|
25 |
* Conselleria d'Infraestructures i Transport |
|
26 |
* Av. Blasco Ib??ez, 50 |
|
27 |
* 46010 VALENCIA |
|
28 |
* SPAIN |
|
29 |
* |
|
30 |
* +34 963862235 |
|
31 |
* gvsig@gva.es |
|
32 |
* www.gvsig.gva.es |
|
33 |
* |
|
34 |
* or |
|
35 |
* |
|
36 |
* IVER T.I. S.A |
|
37 |
* Salamanca 50 |
|
38 |
* 46005 Valencia |
|
39 |
* Spain |
|
40 |
* |
|
41 |
* +34 963163400 |
|
42 |
* dac@iver.es |
|
43 |
*/ |
|
44 |
/* CVS MESSAGES: |
|
45 |
* |
|
46 |
* $Id: IXSExtension.java 151 2007-06-14 16:15:05Z jorpiell $ |
|
47 |
* $Log$ |
|
48 |
* Revision 1.1 2007/06/14 16:15:03 jorpiell |
|
49 |
* builds to create the jars generated and add the schema code to the libGPEProject |
|
50 |
* |
|
51 |
* Revision 1.1 2007/06/14 13:50:07 jorpiell |
|
52 |
* The schema jar name has been changed |
|
53 |
* |
|
54 |
* Revision 1.2 2007/05/30 12:25:48 jorpiell |
|
55 |
* Add the element collection |
|
56 |
* |
|
57 |
* Revision 1.1 2007/05/25 11:55:00 jorpiell |
|
58 |
* First update |
|
59 |
* |
|
60 |
* |
|
61 |
*/ |
|
62 |
/** |
|
63 |
* This interface represents a XML schema extension element. |
|
64 |
* Example: |
|
65 |
* <p> |
|
66 |
* <pre> |
|
67 |
* <code> |
|
68 |
* <extension |
|
69 |
* base = QName |
|
70 |
* id = ID |
|
71 |
* {any attributes with non-schema namespace . . .}> |
|
72 |
* Content: (annotation?, ((attribute | attributeGroup)*, anyAttribute?)) |
|
73 |
* </extensiont> |
|
74 |
* </code> |
|
75 |
* </pre> |
|
76 |
* </p> |
|
77 |
* @see http://www.w3.org/TR/xmlschema-1/#Complex_Type_Definition_details |
|
78 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
79 |
*/ |
|
80 |
public interface IXSExtension extends IXSComponent{ |
|
81 |
|
|
82 |
public IXSGroup getGroup(); |
|
83 |
} |
|
0 | 84 |
org.gvsig.xmlschema/library/tags/org.gvsig.xmlschema-2.0.13/org.gvsig.xmlschema.lib/org.gvsig.xmlschema.lib.api/src/main/java/org/gvsig/xmlschema/lib/api/som/IXSContentType.java | ||
---|---|---|
1 |
package org.gvsig.xmlschema.lib.api.som; |
|
2 |
|
|
3 |
import org.gvsig.xmlschema.lib.api.utils.SchemaTags; |
|
4 |
|
|
5 |
|
|
6 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
7 |
* |
|
8 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
9 |
* |
|
10 |
* This program is free software; you can redistribute it and/or |
|
11 |
* modify it under the terms of the GNU General Public License |
|
12 |
* as published by the Free Software Foundation; either version 2 |
|
13 |
* of the License, or (at your option) any later version. |
|
14 |
* |
|
15 |
* This program is distributed in the hope that it will be useful, |
|
16 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
17 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
18 |
* GNU General Public License for more details. |
|
19 |
* |
|
20 |
* You should have received a copy of the GNU General Public License |
|
21 |
* along with this program; if not, write to the Free Software |
|
22 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
23 |
* |
|
24 |
* For more information, contact: |
|
25 |
* |
|
26 |
* Generalitat Valenciana |
|
27 |
* Conselleria d'Infraestructures i Transport |
|
28 |
* Av. Blasco Ib??ez, 50 |
|
29 |
* 46010 VALENCIA |
|
30 |
* SPAIN |
|
31 |
* |
|
32 |
* +34 963862235 |
|
33 |
* gvsig@gva.es |
|
34 |
* www.gvsig.gva.es |
|
35 |
* |
|
36 |
* or |
|
37 |
* |
|
38 |
* IVER T.I. S.A |
|
39 |
* Salamanca 50 |
|
40 |
* 46005 Valencia |
|
41 |
* Spain |
|
42 |
* |
|
43 |
* +34 963163400 |
|
44 |
* dac@iver.es |
|
45 |
*/ |
|
46 |
/* CVS MESSAGES: |
|
47 |
* |
|
48 |
* $Id: IXSContentType.java 157 2007-06-22 12:22:53Z jorpiell $ |
|
49 |
* $Log$ |
|
50 |
* Revision 1.2 2007/06/22 12:20:48 jorpiell |
|
51 |
* The typeNotFoundException has been deleted. It never was thrown |
|
52 |
* |
|
53 |
* Revision 1.1 2007/06/14 16:15:03 jorpiell |
|
54 |
* builds to create the jars generated and add the schema code to the libGPEProject |
|
55 |
* |
|
56 |
* Revision 1.1 2007/06/14 13:50:07 jorpiell |
|
57 |
* The schema jar name has been changed |
|
58 |
* |
|
59 |
* Revision 1.2 2007/06/08 11:35:16 jorpiell |
|
60 |
* IXSSchema interface updated |
|
61 |
* |
|
62 |
* Revision 1.1 2007/06/07 14:54:13 jorpiell |
|
63 |
* Add the schema support |
|
64 |
* |
|
65 |
* |
|
66 |
*/ |
|
67 |
/** |
|
68 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
69 |
*/ |
|
70 |
public interface IXSContentType extends IXSComponent{ |
|
71 |
public static final String WITOUT_CONTENT = "N"; |
|
72 |
public static final String COMPLEX_CONTENT = SchemaTags.COMPLEX_CONTENT; |
|
73 |
public static final String SIMPLE_CONTENT = SchemaTags.SIMPLE_CONTENT; |
|
74 |
//restrictions |
|
75 |
public static final String WITOUT_RESTRICTION = "N"; |
|
76 |
public static final String EXTENSION = SchemaTags.EXTENSION; |
|
77 |
public static final String RESTRICTION = SchemaTags.RESTRICTION; |
|
78 |
|
|
79 |
/** |
|
80 |
* @return the content type restriction |
|
81 |
*/ |
|
82 |
public IXSRestriction getRestriction(); |
|
83 |
|
|
84 |
/** |
|
85 |
* @returnm the content type extension |
|
86 |
*/ |
|
87 |
public IXSExtension getExtension(); |
|
88 |
} |
|
0 | 89 |
org.gvsig.xmlschema/library/tags/org.gvsig.xmlschema-2.0.13/org.gvsig.xmlschema.lib/org.gvsig.xmlschema.lib.api/src/main/java/org/gvsig/xmlschema/lib/api/som/IXSDocument.java | ||
---|---|---|
1 |
package org.gvsig.xmlschema.lib.api.som; |
|
2 |
|
|
3 |
|
|
4 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
5 |
* |
|
6 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
7 |
* of the Valencian Government (CIT) |
|
8 |
* |
|
9 |
* This program is free software; you can redistribute it and/or |
|
10 |
* modify it under the terms of the GNU General Public License |
|
11 |
* as published by the Free Software Foundation; either version 2 |
|
12 |
* of the License, or (at your option) any later version. |
|
13 |
* |
|
14 |
* This program is distributed in the hope that it will be useful, |
|
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
17 |
* GNU General Public License for more details. |
|
18 |
* |
|
19 |
* You should have received a copy of the GNU General Public License |
|
20 |
* along with this program; if not, write to the Free Software |
|
21 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
22 |
* MA 02110-1301, USA. |
|
23 |
* |
|
24 |
*/ |
|
25 |
|
|
26 |
/* |
|
27 |
* AUTHORS (In addition to CIT): |
|
28 |
* 2010 {Prodevelop T.I.} {Task} |
|
29 |
*/ |
|
30 |
|
|
31 |
public interface IXSDocument { |
|
32 |
|
|
33 |
public IXSElement getDocumentElement(); |
|
34 |
|
|
35 |
public IXSElement createElement(String addXSQname); |
|
36 |
|
|
37 |
} |
|
0 | 38 |
org.gvsig.xmlschema/library/tags/org.gvsig.xmlschema-2.0.13/org.gvsig.xmlschema.lib/org.gvsig.xmlschema.lib.api/src/main/java/org/gvsig/xmlschema/lib/api/som/IXSNodeList.java | ||
---|---|---|
1 |
package org.gvsig.xmlschema.lib.api.som; |
|
2 |
|
|
3 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
4 |
* |
|
5 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
6 |
* of the Valencian Government (CIT) |
|
7 |
* |
Also available in: Unified diff