Commit 713134ba authored by Claus Nagel's avatar Claus Nagel
Browse files

0.3.0pre: intermediate commit to make changes persistent

do not update to this revision.
parent 5315090d
<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:sch="http://www.ascc.net/xml/schematron" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="3.1.1">
<annotation>
<appinfo source="urn:opengis:specification:gml:schema-xsd:feature:v3.1.1"/>
<documentation>GML Feature schema.
Copyright (c) 2001-2005 OGC, All Rights Reserved.
For conditions, see OGC Software Notice http://www.opengeospatial.org/about/?page=ipr</documentation>
</annotation>
<!-- ============================================================== -->
<!-- ================== includes and imports ======================= -->
<!-- ============================================================== -->
<include schemaLocation="geometryBasic2d.xsd"/>
<include schemaLocation="temporal.xsd"/>
<!-- ============================================================== -->
<element name="_Feature" type="gml:AbstractFeatureType" abstract="true" substitutionGroup="gml:_GML"/>
<!-- =========================================================== -->
<complexType name="AbstractFeatureType" abstract="true">
<annotation>
<documentation>An abstract feature provides a set of common properties, including id, metaDataProperty, name and description inherited from AbstractGMLType, plus boundedBy. A concrete feature type must derive from this type and specify additional properties in an application schema. A feature must possess an identifying attribute ('id' - 'fid' has been deprecated).</documentation>
</annotation>
<complexContent>
<extension base="gml:AbstractGMLType">
<sequence>
<element ref="gml:boundedBy" minOccurs="0"/>
<element ref="gml:location" minOccurs="0">
<annotation>
<appinfo>deprecated</appinfo>
<documentation>deprecated in GML version 3.1</documentation>
</annotation>
</element>
<!-- additional properties must be specified in an application schema -->
</sequence>
</extension>
</complexContent>
</complexType>
<!-- ============================================================== -->
<!-- =========================================================== -->
<element name="boundedBy" type="gml:BoundingShapeType"/>
<!-- ====================================================================== -->
<complexType name="BoundingShapeType">
<annotation>
<documentation>Bounding shape.</documentation>
</annotation>
<sequence>
<choice>
<element ref="gml:Envelope"/>
<element ref="gml:Null"/>
</choice>
</sequence>
</complexType>
<!-- =========================================================== -->
<element name="EnvelopeWithTimePeriod" type="gml:EnvelopeWithTimePeriodType" substitutionGroup="gml:Envelope"/>
<!-- ====================================================================== -->
<complexType name="EnvelopeWithTimePeriodType">
<annotation>
<documentation>Envelope that includes also a temporal extent.</documentation>
</annotation>
<complexContent>
<extension base="gml:EnvelopeType">
<sequence>
<element ref="gml:timePosition" minOccurs="2" maxOccurs="2"/>
</sequence>
<attribute name="frame" type="anyURI" use="optional" default="#ISO-8601"/>
</extension>
</complexContent>
</complexType>
<!-- ====================================================================== -->
<!-- ===== property for feature association ==== -->
<element name="featureMember" type="gml:FeaturePropertyType"/>
<element name="featureProperty" type="gml:FeaturePropertyType"/>
<!-- ============================================================== -->
<complexType name="FeaturePropertyType">
<annotation>
<documentation>Container for a feature - follow gml:AssociationType pattern.</documentation>
</annotation>
<sequence minOccurs="0">
<element ref="gml:_Feature"/>
</sequence>
<attributeGroup ref="gml:AssociationAttributeGroup"/>
</complexType>
<!-- ============================================================== -->
<!-- ===== property for association of an array of features ===== -->
<element name="featureMembers" type="gml:FeatureArrayPropertyType"/>
<!-- =========================================================== -->
<complexType name="FeatureArrayPropertyType">
<annotation>
<documentation>Container for features - follow gml:ArrayAssociationType pattern.</documentation>
</annotation>
<sequence>
<element ref="gml:_Feature" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
<!-- ============================================================== -->
<!-- =========================================================== -->
<element name="_FeatureCollection" type="gml:AbstractFeatureCollectionType" abstract="true" substitutionGroup="gml:_Feature"/>
<!-- =========================================================== -->
<complexType name="AbstractFeatureCollectionType" abstract="true">
<annotation>
<documentation>A feature collection contains zero or more features.</documentation>
</annotation>
<complexContent>
<extension base="gml:AbstractFeatureType">
<sequence>
<element ref="gml:featureMember" minOccurs="0" maxOccurs="unbounded"/>
<element ref="gml:featureMembers" minOccurs="0"/>
</sequence>
</extension>
</complexContent>
</complexType>
<!-- =========================================================== -->
<element name="FeatureCollection" type="gml:FeatureCollectionType" substitutionGroup="gml:_Feature"/>
<!-- =========================================================== -->
<complexType name="FeatureCollectionType">
<annotation>
<documentation>Concrete generic feature collection.</documentation>
</annotation>
<complexContent>
<extension base="gml:AbstractFeatureCollectionType"/>
</complexContent>
</complexType>
<!-- ============================================================== -->
<!-- ============================================================== -->
<element name="LocationKeyWord" type="gml:CodeType"/>
<element name="LocationString" type="gml:StringOrRefType"/>
<!-- =========================================================== -->
<!-- ============= common aliases for geometry properties =============== -->
<element name="centerOf" type="gml:PointPropertyType"/>
<element name="position" type="gml:PointPropertyType"/>
<element name="edgeOf" type="gml:CurvePropertyType"/>
<element name="centerLineOf" type="gml:CurvePropertyType"/>
<element name="extentOf" type="gml:SurfacePropertyType"/>
<!-- =========================================================== -->
<!-- ================= deprecated components =========================== -->
<complexType name="BoundedFeatureType" abstract="true">
<annotation>
<documentation>Makes boundedBy mandatory</documentation>
</annotation>
<complexContent>
<restriction base="gml:AbstractFeatureType">
<sequence>
<group ref="gml:StandardObjectProperties"/>
<element ref="gml:boundedBy"/>
<element ref="gml:location" minOccurs="0">
<annotation>
<appinfo>deprecated</appinfo>
<documentation>deprecated in GML version 3.1</documentation>
</annotation>
</element>
</sequence>
</restriction>
</complexContent>
</complexType>
<!-- =========================================================== -->
<element name="location" type="gml:LocationPropertyType">
<annotation>
<documentation>Deprecated in GML 3.1.0</documentation>
</annotation>
</element>
<!-- ============================================================== -->
<complexType name="LocationPropertyType">
<annotation>
<documentation>Convenience property for generalised location.
A representative location for plotting or analysis.
Often augmented by one or more additional geometry properties with more specific semantics.</documentation>
<documentation>Deprecated in GML 3.1.0</documentation>
</annotation>
<sequence minOccurs="0">
<choice>
<element ref="gml:_Geometry"/>
<element ref="gml:LocationKeyWord"/>
<element ref="gml:LocationString"/>
<element ref="gml:Null"/>
</choice>
</sequence>
<attributeGroup ref="gml:AssociationAttributeGroup"/>
</complexType>
<!-- ============================================================== -->
<element name="priorityLocation" type="gml:PriorityLocationPropertyType" substitutionGroup="gml:location">
<annotation>
<documentation>Deprecated in GML 3.1.0</documentation>
</annotation>
</element>
<!-- ============================================================== -->
<complexType name="PriorityLocationPropertyType">
<annotation>
<documentation>G-XML component</documentation>
<documentation>Deprecated in GML 3.1.0</documentation>
</annotation>
<complexContent>
<extension base="gml:LocationPropertyType">
<attribute name="priority" type="string" use="optional"/>
</extension>
</complexContent>
</complexType>
<!-- ============================================================== -->
</schema>
\ No newline at end of file
This diff is collapsed.
...@@ -3,7 +3,7 @@ package org.citygml4j.ade_xjc; ...@@ -3,7 +3,7 @@ package org.citygml4j.ade_xjc;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.PrintStream; import java.io.PrintStream;
import java.math.BigInteger; import java.net.URL;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -22,12 +22,9 @@ import com.sun.tools.xjc.api.XJC; ...@@ -22,12 +22,9 @@ import com.sun.tools.xjc.api.XJC;
public class ADE_XJC { public class ADE_XJC {
private static final Logger LOG = Logger.getInstance(); private static final Logger LOG = Logger.getInstance();
// some dirs we will need
private File schema_dir = new File("schemas");
// some files we will need // some files we will need
private File baseProfileFile = new File(schema_dir.getAbsoluteFile() + "/CityGML/citygml4j_profile.xsd"); private URL baseProfileFile = ADE_XJC.class.getResource("/schemas/CityGML/citygml4j_profile.xsd");
private File bindingFile = new File(schema_dir.getAbsoluteFile() + "/CityGML/binding.xjb"); private URL bindingFile = ADE_XJC.class.getResource("/schemas/CityGML/binding.xjb");
private File adeSchemaFile = null; private File adeSchemaFile = null;
// args // args
...@@ -100,7 +97,7 @@ public class ADE_XJC { ...@@ -100,7 +97,7 @@ public class ADE_XJC {
try { try {
LOG.info("Setting up build environment"); LOG.info("Setting up build environment");
checkBuildEnvironment(); //checkBuildEnvironment();
if (clean) { if (clean) {
LOG.info("Cleaning output folder"); LOG.info("Cleaning output folder");
...@@ -124,31 +121,20 @@ public class ADE_XJC { ...@@ -124,31 +121,20 @@ public class ADE_XJC {
SchemaCompiler sc = XJC.createSchemaCompiler(); SchemaCompiler sc = XJC.createSchemaCompiler();
sc.setDefaultPackageName(packageName); sc.setDefaultPackageName(packageName);
sc.setEntityResolver(new XJCEntityResolver());
XJCErrorListener listener = new XJCErrorListener(); XJCErrorListener listener = new XJCErrorListener();
sc.setErrorListener(listener); sc.setErrorListener(listener);
InputSource schema = new InputSource(baseProfileFile.getAbsolutePath()); sc.parseSchema(new InputSource(baseProfileFile.toString()));
schema.setSystemId(baseProfileFile.toURI().toString()); sc.parseSchema(new InputSource(bindingFile.toString()));
sc.parseSchema(schema); sc.parseSchema(new InputSource(adeSchemaFile.getAbsolutePath()));
InputSource binding = new InputSource(bindingFile.getAbsolutePath());
binding.setSystemId(bindingFile.toURI().toString());
sc.parseSchema(binding);
InputSource adeSchema = new InputSource(adeSchemaFile.getAbsolutePath()); if (adeBindingFile != null)
adeSchema.setSystemId(adeSchemaFile.toURI().toString()); sc.parseSchema(new InputSource(adeBindingFile.getAbsolutePath()));
sc.parseSchema(adeSchema);
if (adeBindingFile != null) {
InputSource adeBinding = new InputSource(adeBindingFile.getAbsolutePath());
adeBinding.setSystemId(adeBindingFile.toURI().toString());
sc.parseSchema(adeBinding);
}
S2JJAXBModel model = sc.bind(); S2JJAXBModel model = sc.bind();
JCodeModel code = model.generateCode(null, listener); JCodeModel code = model.generateCode(null, listener);
code.build(outputFolder, (PrintStream)null); code.build(outputFolder, (PrintStream)null);
File packageDir = new File(outputFolder.getAbsolutePath()); File packageDir = new File(outputFolder.getAbsolutePath());
...@@ -186,7 +172,7 @@ public class ADE_XJC { ...@@ -186,7 +172,7 @@ public class ADE_XJC {
} }
private void checkBuildEnvironment() throws Exception, FileNotFoundException, NoSuchAlgorithmException { private void checkBuildEnvironment() throws Exception, FileNotFoundException, NoSuchAlgorithmException {
if (!schema_dir.exists()) /*if (!schema_dir.exists())
throw new FileNotFoundException("Could not open folder " + schema_dir.getAbsolutePath()); throw new FileNotFoundException("Could not open folder " + schema_dir.getAbsolutePath());
if (!nonStrict) { if (!nonStrict) {
...@@ -209,7 +195,7 @@ public class ADE_XJC { ...@@ -209,7 +195,7 @@ public class ADE_XJC {
if (adeBindingFile != null && (!adeBindingFile.exists() || !adeBindingFile.isFile() || !adeBindingFile.canRead())) if (adeBindingFile != null && (!adeBindingFile.exists() || !adeBindingFile.isFile() || !adeBindingFile.canRead()))
throw new Exception("Could not open ADE binding file " + adeBindingFile.getAbsolutePath()); throw new Exception("Could not open ADE binding file " + adeBindingFile.getAbsolutePath());
*/
} }
private void cleanBuildEnvironment() { private void cleanBuildEnvironment() {
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment