From ada38ab0a1a98dcb413bef3273064da36ce2d273 Mon Sep 17 00:00:00 2001 From: luukkainen Date: Wed, 27 Jan 2016 07:36:45 +0000 Subject: [PATCH] XML Schema converter refs #6292 git-svn-id: https://www.simantics.org/svn/simantics/interoperability/trunk@32319 ac1ea38d-2e2b-0410-8846-a27921b304fc --- org.simantics.xml.sax.base/.classpath | 7 + org.simantics.xml.sax.base/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 13 + org.simantics.xml.sax.base/build.properties | 4 + .../xml/sax/base/AbstractImporter.java | 104 + .../org/simantics/xml/sax/base/Attribute.java | 34 + .../org/simantics/xml/sax/base/Element.java | 76 + .../xml/sax/base/IDReferenceParser.java | 12 + .../sax/base/UnrecognizedElementParser.java | 11 + .../xml/sax/base/ValueElementParser.java | 80 + .../sax/base/XMLElementNamedChildParser.java | 7 + .../base/XMLElementNamedChildParserBase.java | 62 + .../xml/sax/base/XMLElementParser.java | 75 + .../xml/sax/base/XMLElementParserBase.java | 24 + .../org/simantics/xml/sax/base/XMLParser.java | 237 ++ org.simantics.xml.sax.ui/.classpath | 7 + org.simantics.xml.sax.ui/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 7 + org.simantics.xml.sax.ui/META-INF/MANIFEST.MF | 11 + org.simantics.xml.sax.ui/build.properties | 5 + org.simantics.xml.sax.ui/plugin.xml | 16 + .../xml/sax/ui/wizard/ImportProcessPage.java | 111 + .../xml/sax/ui/wizard/InputSelectionPage.java | 70 + .../sax/ui/wizard/SchemaConversionWizard.java | 63 + org.simantics.xml.sax/.classpath | 7 + org.simantics.xml.sax/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 7 + org.simantics.xml.sax/META-INF/MANIFEST.MF | 9 + org.simantics.xml.sax/build.properties | 4 + org.simantics.xml.sax/schema/XMLSchema.xsd | 2358 +++++++++++++++++ .../schema/configuration.xsd | 113 + org.simantics.xml.sax/schema/gen.bat | 1 + .../simantics/xml/sax/ImporterGenerator.java | 1008 +++++++ .../xml/sax/MultiplicityRestriction.java | 94 + .../simantics/xml/sax/OntologyGenerator.java | 594 +++++ .../xml/sax/SchemaConversionBase.java | 936 +++++++ .../simantics/xml/sax/SchemaConverter.java | 121 + .../org/simantics/xml/sax/SchemaElement.java | 102 + .../org/simantics/xml/sax/SchemaObject.java | 109 + .../xml/sax/configuration/Attribute.java | 92 + .../configuration/AttributeComposition.java | 133 + .../xml/sax/configuration/ComplexType.java | 65 + .../xml/sax/configuration/Configuration.java | 82 + .../xml/sax/configuration/ConversionRule.java | 45 + .../xml/sax/configuration/Element.java | 65 + .../xml/sax/configuration/IDProvider.java | 158 ++ .../xml/sax/configuration/IDReference.java | 157 ++ .../xml/sax/configuration/ObjectFactory.java | 222 ++ .../xml/sax/configuration/OrderedChild.java | 184 ++ .../UnrecognizedChildElement.java | 129 + .../xml/sax/configuration/package-info.java | 9 + .../src/org/w3/_2001/xmlschema/All.java | 59 + .../src/org/w3/_2001/xmlschema/Annotated.java | 134 + .../org/w3/_2001/xmlschema/Annotation.java | 122 + .../src/org/w3/_2001/xmlschema/Any.java | 108 + .../src/org/w3/_2001/xmlschema/Appinfo.java | 138 + .../src/org/w3/_2001/xmlschema/Attribute.java | 282 ++ .../w3/_2001/xmlschema/AttributeGroup.java | 173 ++ .../w3/_2001/xmlschema/AttributeGroupRef.java | 44 + .../w3/_2001/xmlschema/ComplexContent.java | 127 + .../xmlschema/ComplexRestrictionType.java | 47 + .../org/w3/_2001/xmlschema/ComplexType.java | 430 +++ .../w3/_2001/xmlschema/DerivationControl.java | 67 + .../org/w3/_2001/xmlschema/Documentation.java | 165 ++ .../src/org/w3/_2001/xmlschema/Element.java | 542 ++++ .../org/w3/_2001/xmlschema/ExplicitGroup.java | 52 + .../org/w3/_2001/xmlschema/ExtensionType.java | 248 ++ .../src/org/w3/_2001/xmlschema/Facet.java | 107 + .../src/org/w3/_2001/xmlschema/Field.java | 79 + .../org/w3/_2001/xmlschema/FormChoice.java | 58 + .../src/org/w3/_2001/xmlschema/Group.java | 224 ++ .../src/org/w3/_2001/xmlschema/GroupRef.java | 44 + .../src/org/w3/_2001/xmlschema/Import.java | 100 + .../src/org/w3/_2001/xmlschema/Include.java | 72 + .../src/org/w3/_2001/xmlschema/Keybase.java | 144 + .../src/org/w3/_2001/xmlschema/Keyref.java | 71 + .../src/org/w3/_2001/xmlschema/List.java | 106 + .../w3/_2001/xmlschema/LocalComplexType.java | 44 + .../org/w3/_2001/xmlschema/LocalElement.java | 52 + .../w3/_2001/xmlschema/LocalSimpleType.java | 44 + .../_2001/xmlschema/NamedAttributeGroup.java | 45 + .../org/w3/_2001/xmlschema/NamedGroup.java | 58 + .../org/w3/_2001/xmlschema/NarrowMaxMin.java | 66 + .../org/w3/_2001/xmlschema/NoFixedFacet.java | 47 + .../src/org/w3/_2001/xmlschema/Notation.java | 132 + .../src/org/w3/_2001/xmlschema/NumFacet.java | 48 + .../org/w3/_2001/xmlschema/ObjectFactory.java | 662 +++++ .../src/org/w3/_2001/xmlschema/OpenAttrs.java | 75 + .../src/org/w3/_2001/xmlschema/Pattern.java | 46 + .../src/org/w3/_2001/xmlschema/RealGroup.java | 53 + .../src/org/w3/_2001/xmlschema/Redefine.java | 156 ++ .../xmlschema/ReducedDerivationControl.java | 58 + .../org/w3/_2001/xmlschema/Restriction.java | 165 ++ .../w3/_2001/xmlschema/RestrictionType.java | 337 +++ .../src/org/w3/_2001/xmlschema/Schema.java | 394 +++ .../src/org/w3/_2001/xmlschema/Selector.java | 79 + .../org/w3/_2001/xmlschema/SimpleContent.java | 99 + .../_2001/xmlschema/SimpleExplicitGroup.java | 44 + .../_2001/xmlschema/SimpleExtensionType.java | 44 + .../xmlschema/SimpleRestrictionType.java | 47 + .../org/w3/_2001/xmlschema/SimpleType.java | 192 ++ .../w3/_2001/xmlschema/TopLevelAttribute.java | 45 + .../_2001/xmlschema/TopLevelComplexType.java | 45 + .../w3/_2001/xmlschema/TopLevelElement.java | 49 + .../_2001/xmlschema/TopLevelSimpleType.java | 45 + .../org/w3/_2001/xmlschema/TotalDigits.java | 46 + .../xmlschema/TypeDerivationControl.java | 64 + .../src/org/w3/_2001/xmlschema/Union.java | 122 + .../org/w3/_2001/xmlschema/WhiteSpace.java | 54 + .../src/org/w3/_2001/xmlschema/Wildcard.java | 123 + .../org/w3/_2001/xmlschema/package-info.java | 9 + 112 files changed, 15263 insertions(+) create mode 100644 org.simantics.xml.sax.base/.classpath create mode 100644 org.simantics.xml.sax.base/.project create mode 100644 org.simantics.xml.sax.base/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.simantics.xml.sax.base/META-INF/MANIFEST.MF create mode 100644 org.simantics.xml.sax.base/build.properties create mode 100644 org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/AbstractImporter.java create mode 100644 org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/Attribute.java create mode 100644 org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/Element.java create mode 100644 org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/IDReferenceParser.java create mode 100644 org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/UnrecognizedElementParser.java create mode 100644 org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/ValueElementParser.java create mode 100644 org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/XMLElementNamedChildParser.java create mode 100644 org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/XMLElementNamedChildParserBase.java create mode 100644 org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/XMLElementParser.java create mode 100644 org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/XMLElementParserBase.java create mode 100644 org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/XMLParser.java create mode 100644 org.simantics.xml.sax.ui/.classpath create mode 100644 org.simantics.xml.sax.ui/.project create mode 100644 org.simantics.xml.sax.ui/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.simantics.xml.sax.ui/META-INF/MANIFEST.MF create mode 100644 org.simantics.xml.sax.ui/build.properties create mode 100644 org.simantics.xml.sax.ui/plugin.xml create mode 100644 org.simantics.xml.sax.ui/src/org/simantics/xml/sax/ui/wizard/ImportProcessPage.java create mode 100644 org.simantics.xml.sax.ui/src/org/simantics/xml/sax/ui/wizard/InputSelectionPage.java create mode 100644 org.simantics.xml.sax.ui/src/org/simantics/xml/sax/ui/wizard/SchemaConversionWizard.java create mode 100644 org.simantics.xml.sax/.classpath create mode 100644 org.simantics.xml.sax/.project create mode 100644 org.simantics.xml.sax/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.simantics.xml.sax/META-INF/MANIFEST.MF create mode 100644 org.simantics.xml.sax/build.properties create mode 100644 org.simantics.xml.sax/schema/XMLSchema.xsd create mode 100644 org.simantics.xml.sax/schema/configuration.xsd create mode 100644 org.simantics.xml.sax/schema/gen.bat create mode 100644 org.simantics.xml.sax/src/org/simantics/xml/sax/ImporterGenerator.java create mode 100644 org.simantics.xml.sax/src/org/simantics/xml/sax/MultiplicityRestriction.java create mode 100644 org.simantics.xml.sax/src/org/simantics/xml/sax/OntologyGenerator.java create mode 100644 org.simantics.xml.sax/src/org/simantics/xml/sax/SchemaConversionBase.java create mode 100644 org.simantics.xml.sax/src/org/simantics/xml/sax/SchemaConverter.java create mode 100644 org.simantics.xml.sax/src/org/simantics/xml/sax/SchemaElement.java create mode 100644 org.simantics.xml.sax/src/org/simantics/xml/sax/SchemaObject.java create mode 100644 org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/Attribute.java create mode 100644 org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/AttributeComposition.java create mode 100644 org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/ComplexType.java create mode 100644 org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/Configuration.java create mode 100644 org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/ConversionRule.java create mode 100644 org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/Element.java create mode 100644 org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/IDProvider.java create mode 100644 org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/IDReference.java create mode 100644 org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/ObjectFactory.java create mode 100644 org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/OrderedChild.java create mode 100644 org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/UnrecognizedChildElement.java create mode 100644 org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/package-info.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/All.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Annotated.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Annotation.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Any.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Appinfo.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Attribute.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/AttributeGroup.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/AttributeGroupRef.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ComplexContent.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ComplexRestrictionType.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ComplexType.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/DerivationControl.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Documentation.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Element.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ExplicitGroup.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ExtensionType.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Facet.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Field.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/FormChoice.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Group.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/GroupRef.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Import.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Include.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Keybase.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Keyref.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/List.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/LocalComplexType.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/LocalElement.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/LocalSimpleType.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/NamedAttributeGroup.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/NamedGroup.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/NarrowMaxMin.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/NoFixedFacet.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Notation.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/NumFacet.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ObjectFactory.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/OpenAttrs.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Pattern.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/RealGroup.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Redefine.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ReducedDerivationControl.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Restriction.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/RestrictionType.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Schema.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Selector.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/SimpleContent.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/SimpleExplicitGroup.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/SimpleExtensionType.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/SimpleRestrictionType.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/SimpleType.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TopLevelAttribute.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TopLevelComplexType.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TopLevelElement.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TopLevelSimpleType.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TotalDigits.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TypeDerivationControl.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Union.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/WhiteSpace.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Wildcard.java create mode 100644 org.simantics.xml.sax/src/org/w3/_2001/xmlschema/package-info.java diff --git a/org.simantics.xml.sax.base/.classpath b/org.simantics.xml.sax.base/.classpath new file mode 100644 index 0000000..b1dabee --- /dev/null +++ b/org.simantics.xml.sax.base/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.simantics.xml.sax.base/.project b/org.simantics.xml.sax.base/.project new file mode 100644 index 0000000..a92f6b0 --- /dev/null +++ b/org.simantics.xml.sax.base/.project @@ -0,0 +1,28 @@ + + + org.simantics.xml.sax.base + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.simantics.xml.sax.base/.settings/org.eclipse.jdt.core.prefs b/org.simantics.xml.sax.base/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..11f6e46 --- /dev/null +++ b/org.simantics.xml.sax.base/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/org.simantics.xml.sax.base/META-INF/MANIFEST.MF b/org.simantics.xml.sax.base/META-INF/MANIFEST.MF new file mode 100644 index 0000000..b846036 --- /dev/null +++ b/org.simantics.xml.sax.base/META-INF/MANIFEST.MF @@ -0,0 +1,13 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Sax Parser Base +Bundle-SymbolicName: org.simantics.xml.sax.base +Bundle-Version: 1.0.0.qualifier +Bundle-Vendor: VTT +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Require-Bundle: org.eclipse.core.runtime, + org.simantics.db;bundle-version="1.1.0", + org.simantics.db.common;bundle-version="1.1.0", + org.simantics.db.layer0;bundle-version="1.1.0", + org.simantics.message;bundle-version="1.1.0" +Export-Package: org.simantics.xml.sax.base diff --git a/org.simantics.xml.sax.base/build.properties b/org.simantics.xml.sax.base/build.properties new file mode 100644 index 0000000..41eb6ad --- /dev/null +++ b/org.simantics.xml.sax.base/build.properties @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . diff --git a/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/AbstractImporter.java b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/AbstractImporter.java new file mode 100644 index 0000000..af5c2c3 --- /dev/null +++ b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/AbstractImporter.java @@ -0,0 +1,104 @@ +package org.simantics.xml.sax.base; + +import java.io.File; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.simantics.db.Resource; +import org.simantics.db.Session; +import org.simantics.db.WriteGraph; +import org.simantics.db.common.request.DelayedWriteRequest; +import org.simantics.db.common.request.WriteRequest; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.layer0.util.Layer0Utils; +import org.simantics.message.ILogger; +import org.simantics.message.MessageService; + + +public abstract class AbstractImporter { + + + private Session session; + private File file; + private ILogger logger; + + private static final boolean USE_DELAYED = false; + + public AbstractImporter(Session session, File file) { + this.session = session; + this.file = file; + } + public Resource doImport() throws DatabaseException { + return doImport(MessageService.getDefault()); + } + + public Resource doImport(ILogger logger) throws DatabaseException { + this.logger = logger; + if (USE_DELAYED) { + ImportDelayedRequest req = new ImportDelayedRequest(); + session.syncRequest(req); + return req.getResult(); + } else { + ImportRequest req = new ImportRequest(); + session.syncRequest(req); + return req.getResult(); + } + } + + public File getFile() { + return file; + } + + public abstract void configure(XMLParser parser); + + private class ImportRequest extends WriteRequest { + private Resource result; + public ImportRequest() { + super(); + } + + @Override + public void perform(WriteGraph graph) throws DatabaseException { + result = doImport(graph); + } + + public Resource getResult() { + return result; + } + } + + private class ImportDelayedRequest extends DelayedWriteRequest { + private Resource result; + public ImportDelayedRequest() { + super(); + } + + @Override + public void perform(WriteGraph graph) throws DatabaseException { + result = doImport(graph); + } + + public Resource getResult() { + return result; + } + } + + private Resource doImport(WriteGraph graph) throws DatabaseException { + Layer0Utils.setDependenciesIndexingDisabled(graph, true); + try { + XMLParser parser = new XMLParser(graph); + configure(parser); + parser.parse(file, logger); + System.out.println(file.getAbsolutePath() + " imported"); + Resource root = parser.getRoot(); + if (root == null) { + throw new DatabaseException(file.getAbsolutePath() + " import failed. File is corrupted, or is not given type"); + } + return root; + } catch (DatabaseException e) { + throw e; + } catch (Exception e) { + throw new DatabaseException(e); + } + } +} diff --git a/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/Attribute.java b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/Attribute.java new file mode 100644 index 0000000..6e47ddf --- /dev/null +++ b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/Attribute.java @@ -0,0 +1,34 @@ +package org.simantics.xml.sax.base; + +public class Attribute { + public String localName; + public String qName; + public String uri; + public String value; + + public Attribute(String localName, String qName, String uri, String value) { + this.localName = localName; + this.qName = qName; + this.uri = uri; + this.value = value; + } + + + public String getUri() { + return uri; + } + + public String getQName() { + return qName; + } + + public String getLocalName() { + return localName; + } + + public String getValue() { + return value; + } + + +} \ No newline at end of file diff --git a/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/Element.java b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/Element.java new file mode 100644 index 0000000..3aba943 --- /dev/null +++ b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/Element.java @@ -0,0 +1,76 @@ +package org.simantics.xml.sax.base; + +import java.io.Serializable; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import org.simantics.db.Resource; +import org.xml.sax.Attributes; + +public class Element implements Serializable { + private static final long serialVersionUID = -5207502156942818875L; + String uri; + String localName; + String qName; + Map attributes = new HashMap(); + + XMLElementParser parser; + + public Element(String uri, String localName, String qName, Attributes attributes) { + this.uri = uri; + this.localName = localName; + this.qName = qName; + for (int i = 0; i < attributes.getLength(); i++) { + this.attributes.put(attributes.getLocalName(i),new Attribute(attributes.getLocalName(i),attributes.getQName(i),attributes.getURI(i),attributes.getValue(i))); + } + } + + public Element(String uri, String localName, String qName, Collection attributes) { + this.uri = uri; + this.localName = localName; + this.qName = qName; + for (Attribute a : attributes) { + this.attributes.put(a.localName,new Attribute(a.localName,a.qName,a.uri,a.value)); + } + } + + public String getUri() { + return uri; + } + + public String getLocalName() { + return localName; + } + + public String getQName() { + return qName; + } + + public Collection getAttributes() { + return attributes.values(); + } + + public Attribute getAttribute(String name) { + return attributes.get(name); + } + + private Resource data; + + public void setData(Resource data) { + this.data = data; + } + + public Resource getData() { + return data; + } + + public void setParser(XMLElementParser parser) { + this.parser = parser; + } + + public XMLElementParser getParser() { + return parser; + } + +} \ No newline at end of file diff --git a/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/IDReferenceParser.java b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/IDReferenceParser.java new file mode 100644 index 0000000..fb74fd3 --- /dev/null +++ b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/IDReferenceParser.java @@ -0,0 +1,12 @@ +package org.simantics.xml.sax.base; + +import java.util.Map; + +import org.simantics.db.WriteGraph; +import org.simantics.db.exception.DatabaseException; + +public interface IDReferenceParser extends XMLElementParser{ + + public boolean connectReferences(WriteGraph graph, Element element, Map map) throws DatabaseException; + +} diff --git a/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/UnrecognizedElementParser.java b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/UnrecognizedElementParser.java new file mode 100644 index 0000000..d21918b --- /dev/null +++ b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/UnrecognizedElementParser.java @@ -0,0 +1,11 @@ +package org.simantics.xml.sax.base; + +import java.util.Deque; + +import org.simantics.db.WriteGraph; +import org.simantics.db.exception.DatabaseException; + +public interface UnrecognizedElementParser { + + public void configureChild(WriteGraph graph, Deque parents, Element element, Element child) throws DatabaseException; +} diff --git a/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/ValueElementParser.java b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/ValueElementParser.java new file mode 100644 index 0000000..718c8b0 --- /dev/null +++ b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/ValueElementParser.java @@ -0,0 +1,80 @@ +package org.simantics.xml.sax.base; + +import java.util.Deque; + +import org.simantics.databoard.Bindings; +import org.simantics.databoard.binding.Binding; +import org.simantics.db.Resource; +import org.simantics.db.WriteGraph; +import org.simantics.db.exception.DatabaseException; +import org.simantics.layer0.Layer0; + +public class ValueElementParser extends XMLElementParserBase{ + + String name; + Binding binding; + String relationURI; + + public ValueElementParser(String name, String relationURI,Binding binding) { + this.name = name; + this.relationURI = relationURI; + this.binding = binding; + } + + @Override + public String getElementId() { + return name; + } + + @Override + public Resource create(WriteGraph graph, Element element) + throws DatabaseException { + Resource res = graph.newResource(); + return res; + } + + @Override + public void configure(WriteGraph graph, Deque parents, Element element) throws DatabaseException { + } + + @Override + public boolean connectParent(WriteGraph graph, Element parent, Element element)throws DatabaseException { + graph.claim(parent.getData(), graph.getResource(relationURI), element.getData()); + return true; + } + + @Override + public boolean connectChild(WriteGraph graph, Element element, Element child) throws DatabaseException { + return false; + } + + @Override + public void configure(WriteGraph graph, Element element, String string) throws DatabaseException { + Layer0 l0 = Layer0.getInstance(graph); + if (binding == Bindings.STRING) { + graph.claim(element.getData(), l0.InstanceOf, l0.String); + graph.claimValue(element.getData(), string, binding); + } else if (binding == Bindings.INTEGER) { + graph.claim(element.getData(), l0.InstanceOf, l0.Integer); + graph.claimValue(element.getData(), Integer.parseInt(string), binding); + } else if (binding == Bindings.FLOAT) { + graph.claim(element.getData(), l0.InstanceOf, l0.Float); + graph.claimValue(element.getData(), Float.parseFloat(string), binding); + } else if (binding == Bindings.DOUBLE) { + graph.claim(element.getData(), l0.InstanceOf, l0.Double); + graph.claimValue(element.getData(), Double.parseDouble(string), binding); + } else if (binding == Bindings.BOOLEAN) { + graph.claim(element.getData(), l0.InstanceOf, l0.Boolean); + graph.claimValue(element.getData(), Boolean.parseBoolean(string), binding); + } else if (binding == Bindings.LONG) { + graph.claim(element.getData(), l0.InstanceOf, l0.Long); + graph.claimValue(element.getData(), Long.parseLong(string), binding); + } else if (binding == Bindings.BYTE) { + graph.claim(element.getData(), l0.InstanceOf, l0.Byte); + graph.claimValue(element.getData(), Byte.parseByte(string), binding); + } else { + throw new DatabaseException("Unknown datatype " + binding); + } + } + +} diff --git a/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/XMLElementNamedChildParser.java b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/XMLElementNamedChildParser.java new file mode 100644 index 0000000..9085c6b --- /dev/null +++ b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/XMLElementNamedChildParser.java @@ -0,0 +1,7 @@ +package org.simantics.xml.sax.base; + +import java.util.Map; + +public interface XMLElementNamedChildParser extends XMLElementParser{ + Class getParser(Map parsers, Element element, Element child); +} diff --git a/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/XMLElementNamedChildParserBase.java b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/XMLElementNamedChildParserBase.java new file mode 100644 index 0000000..c0a2172 --- /dev/null +++ b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/XMLElementNamedChildParserBase.java @@ -0,0 +1,62 @@ +package org.simantics.xml.sax.base; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.simantics.db.WriteGraph; +import org.simantics.db.exception.DatabaseException; + +public abstract class XMLElementNamedChildParserBase implements XMLElementNamedChildParser{ + + private Map> namedParsers = new HashMap>(); + private Set> parsers = new HashSet>(); + + @Override + public Class getParser(Map parsers, Element element, Element child) { + Class parserClass = namedParsers.get(child.qName); + if (parserClass != null) + return parserClass; + XMLElementParser parser = parsers.get(child.qName); + if (parser == null) + return null; + parserClass = parser.getClass(); + if (this.parsers.contains(parserClass)) + return parserClass; + for (Class c : this.parsers) + if (c.isAssignableFrom(parserClass)) + return parserClass; + return null; + } + + public void addParser(String name, Class parser) { + namedParsers.put(name, parser); + } + + public void addParser(Class parser) { + parsers.add(parser); + } + +// @Override +// public void configureChild(WriteGraph graph, Stack parents, Element element, Element child) throws DatabaseException { +// +// } + + @Override + public void configure(WriteGraph graph, Element element, String string) throws DatabaseException { + + } + + @Override + public String getID() { + return null; + } + + @Override + public int idPriority() { + return 0; + } + + +} diff --git a/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/XMLElementParser.java b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/XMLElementParser.java new file mode 100644 index 0000000..c3b3804 --- /dev/null +++ b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/XMLElementParser.java @@ -0,0 +1,75 @@ +package org.simantics.xml.sax.base; + +import java.util.Deque; + +import org.simantics.db.Resource; +import org.simantics.db.WriteGraph; +import org.simantics.db.exception.DatabaseException; + +public interface XMLElementParser { + /** + * ID of the element + * @return + */ + public String getElementId(); + + + /** + * Priority of the Id. Used with overlapping IDs to select preferred element. + */ + public int idPriority(); + + /** + * Creates a resource for the element. + * + * Called on SAX.startElement + * @param graph + * @param element + * @return + * @throws DatabaseException + */ + public Resource create(WriteGraph graph, Element element) throws DatabaseException; + /** + * Configures the element. + * + * Called on SAX.endElement + * @param graph + * @param parents + * @param element + * @throws DatabaseException + */ + public void configure(WriteGraph graph, Deque parents, Element element) throws DatabaseException; + /** + * Configures element with characters content + * + * Called on SAX.charaters + * @param graph + * @param element + * @param string + * @throws DatabaseException + */ + public void configure(WriteGraph graph, Element element, String string) throws DatabaseException; + + /** + * Adds child element. Primary method for connecting elements. + * @param graph + * @param element + * @param child + * @return true, if connection was done, otherwise return false. + * @throws DatabaseException + */ + public abstract boolean connectChild(WriteGraph graph, Element element, Element child) throws DatabaseException; + /** + * Adds element to a parent. Secondary method for connecting elements. Called only if primary method fails. + * @param graph + * @param parent + * @param element + * @return true, if connection was done, otherwise return false. + * @throws DatabaseException + */ + public abstract boolean connectParent(WriteGraph graph, Element parent, Element element) throws DatabaseException; + + + //public void configureChild(WriteGraph graph, Stack parents, Element element, Element child) throws DatabaseException; + public String getID(); +} \ No newline at end of file diff --git a/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/XMLElementParserBase.java b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/XMLElementParserBase.java new file mode 100644 index 0000000..000d25b --- /dev/null +++ b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/XMLElementParserBase.java @@ -0,0 +1,24 @@ +package org.simantics.xml.sax.base; + +import org.simantics.db.WriteGraph; +import org.simantics.db.exception.DatabaseException; + +public abstract class XMLElementParserBase implements XMLElementParser{ + + + @Override + public void configure(WriteGraph graph, Element element, String string) throws DatabaseException { + + } + + @Override + public String getID() { + return null; + } + + @Override + public int idPriority() { + return 0; + } + +} diff --git a/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/XMLParser.java b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/XMLParser.java new file mode 100644 index 0000000..be8fef0 --- /dev/null +++ b/org.simantics.xml.sax.base/src/org/simantics/xml/sax/base/XMLParser.java @@ -0,0 +1,237 @@ +package org.simantics.xml.sax.base; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.Serializable; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Deque; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.simantics.db.Resource; +import org.simantics.db.WriteGraph; +import org.simantics.db.exception.DatabaseException; +import org.simantics.message.ILogger; +import org.xml.sax.Attributes; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.DefaultHandler; + +public class XMLParser extends DefaultHandler implements Serializable { + + private static final long serialVersionUID = 7360740940824360338L; + private static final boolean debug = false; + private ILogger logger; + private Resource root; + private Deque current = new ArrayDeque(); + private Map parsers = new HashMap(); + private WriteGraph graph; + + private Map, XMLElementParser> namedParsers = new HashMap, XMLElementParser>(); + + public XMLParser(WriteGraph graph) { + this.graph = graph; + } + + public void add(XMLElementParser parser) { + if (parser.getElementId() != null) + parsers.put(parser.getElementId(), parser); + namedParsers.put(parser.getClass(), parser); + } + + + private List idReferenceElements = new ArrayList(); + private void loadElement(Deque parents, Element element) throws SAXException{ + XMLElementParser parser = null; + Element parent = null; + if (parents.size() > 0) { + parent = parents.peek(); + if (parent.getParser() instanceof XMLElementNamedChildParser) { + // use parent's named child parser if it is supported + Class parserClass = ((XMLElementNamedChildParser)parent.getParser()).getParser(parsers,parent,element); + if (parserClass != null) { + parser = namedParsers.get(parserClass); + if (parser == null) { + try { + parser = parserClass.newInstance(); + namedParsers.put(parserClass, parser); + } catch (IllegalAccessException | InstantiationException e) { + String err = "Element parsers must have accessible default constructor"; + logger.log(new Status(IStatus.ERROR, PLUGIN_ID, err)); + throw new SAXException(err, e); + } + } + } +// if (parser == null && ((XMLElementNamedChildParser)parent.getParser()).useGlobalRules()) +// parser = parsers.get(element.qName); + } else { + // otherwise use globally configured element parser + parser = parsers.get(element.qName); + } + } else { + // use globally configured element parser + parser = parsers.get(element.qName); + } + + if (parser != null) { + try { + + element.setData(parser.create(graph, element)); + if (parser instanceof IDReferenceParser) + idReferenceElements.add(element); + element.setParser(parser); + } catch (DatabaseException e) { + throw new SAXException(e); + } + } else { + if (parent == null && parents.size() > 0) + parent = parents.peek(); + String err = "Unknown element " + element.qName + ", parent " + (parent != null ? parent.getQName() : "None"); + logger.log(new Status(IStatus.ERROR, PLUGIN_ID, err)); + if (debug) System.err.println(err); + } + } + + private Map idMap = new HashMap(); + + private void handleElement(Deque parents, Element element) throws SAXException{ + XMLElementParser parser = element.getParser(); + if (parser != null) { + try { + parser.configure(graph, parents, element); + if (parents.size() > 0) { + Element parent = parents.peek(); + if (parent.getParser() != null) { + if (!parent.getParser().connectChild(graph, parent, element)) + if (!parser.connectParent(graph, parent, element)) { + String err = "Did not connect element " + element.qName + ", parent " + (parent != null ? parent.getQName() : "None"); + logger.log(new Status(IStatus.ERROR, PLUGIN_ID, err)); + if (debug) System.err.println(err); + } + } else { + String err = "Did not connect element " + element.qName + ", parent " + (parent != null ? parent.getQName() : "None") + " was not imported"; + logger.log(new Status(IStatus.ERROR, PLUGIN_ID, err)); + if (debug) System.err.println(err); + } + } + String id = parser.getID(); + if (id != null) { + Element existing = idMap.put(id, element); + if (existing != null) { + // report error + use id priorities to select the kept element. + boolean useExt = existing.parser.idPriority() > element.parser.idPriority(); + if (useExt) + idMap.put(id, existing); + String err = "Duplicate XML element id: " + id + " for " + element.getQName() + " and " + existing.getQName() + ", using " + (useExt ? existing.getQName() : element.getQName()); + logger.log(new Status(IStatus.ERROR, PLUGIN_ID, err)); + if (debug) System.err.println(err); + } + } + } catch (DatabaseException e) { + throw new SAXException(e); + } + } else { + Element parent = parents.peek(); + if (parent != null) { + parser = parent.getParser(); + if (parser != null && parser instanceof UnrecognizedElementParser) { + try { + ((UnrecognizedElementParser)parser).configureChild(graph, parents, parent, element); + } catch (DatabaseException e) { + throw new SAXException(e); + } + } + } + } + } + + private void handleCharacters(Element element, String string) throws SAXException{ + XMLElementParser parser = element.getParser(); + if (parser != null) { + try { + parser.configure(graph, element, string); + } catch (DatabaseException e) { + logger.log(new Status(IStatus.ERROR, PLUGIN_ID, e.getMessage())); + throw new SAXException(e); + } + } + } + + private static String PLUGIN_ID = "org.simantics.xml.sax.base"; + + public void done() throws SAXException{ + try { + for (Element e : idReferenceElements) { + IDReferenceParser parser = (IDReferenceParser)parsers.get(e.qName); + if (!parser.connectReferences(graph, e, idMap)) { + String err ="Could not resolve ID references for " + e.getQName() + " " + e.getUri(); + logger.log(new Status(IStatus.ERROR, PLUGIN_ID, err)); + if (debug) System.err.println(err); + } + } + } catch (DatabaseException e) { + throw new SAXException(e); + } + } + + public Resource getRoot() { + return root; + } + + @Override + public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException { + Element e = new Element(uri,localName,name,attributes); + + loadElement(current,e); + current.push(e); + } + + @Override + public void endElement(String uri, String localName, String name) + throws SAXException { + Element e = null; + if (!current.isEmpty()) { + e = current.pop(); + } + if (e != null) { + handleElement(current,e); + } + if (current.isEmpty()) { + root = e.getData(); + } + } + + @Override + public void characters(char[] ch, int start, int length) + throws SAXException { + + if (!current.isEmpty()) { + String s = new String(ch,start,length); + Element e = current.peek(); + handleCharacters(e, s); + } + + } + + public void parse(File file, ILogger logger) throws Exception { + this.logger = logger; + SAXParserFactory spf = SAXParserFactory.newInstance(); + SAXParser saxParser = spf.newSAXParser(); + + XMLReader reader = saxParser.getXMLReader(); + reader.setContentHandler(this); + reader.parse(new InputSource(new BufferedInputStream(new FileInputStream(file)))); + done(); + } + + +} \ No newline at end of file diff --git a/org.simantics.xml.sax.ui/.classpath b/org.simantics.xml.sax.ui/.classpath new file mode 100644 index 0000000..b1dabee --- /dev/null +++ b/org.simantics.xml.sax.ui/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.simantics.xml.sax.ui/.project b/org.simantics.xml.sax.ui/.project new file mode 100644 index 0000000..80114b8 --- /dev/null +++ b/org.simantics.xml.sax.ui/.project @@ -0,0 +1,28 @@ + + + org.simantics.xml.sax.ui + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.simantics.xml.sax.ui/.settings/org.eclipse.jdt.core.prefs b/org.simantics.xml.sax.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..11f6e46 --- /dev/null +++ b/org.simantics.xml.sax.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/org.simantics.xml.sax.ui/META-INF/MANIFEST.MF b/org.simantics.xml.sax.ui/META-INF/MANIFEST.MF new file mode 100644 index 0000000..16b2876 --- /dev/null +++ b/org.simantics.xml.sax.ui/META-INF/MANIFEST.MF @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: XML Sax Parser Generator Ui +Bundle-SymbolicName: org.simantics.xml.sax.ui;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Vendor: VTT +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Require-Bundle: org.simantics.xml.sax;bundle-version="1.0.0", + org.eclipse.core.runtime;bundle-version="3.7.0", + org.eclipse.ui, + org.simantics.utils.ui;bundle-version="1.1.0" diff --git a/org.simantics.xml.sax.ui/build.properties b/org.simantics.xml.sax.ui/build.properties new file mode 100644 index 0000000..6f20375 --- /dev/null +++ b/org.simantics.xml.sax.ui/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff --git a/org.simantics.xml.sax.ui/plugin.xml b/org.simantics.xml.sax.ui/plugin.xml new file mode 100644 index 0000000..f88644b --- /dev/null +++ b/org.simantics.xml.sax.ui/plugin.xml @@ -0,0 +1,16 @@ + + + + + + + Converts XML Schemas to Simantics ontologies and generates SAX Parser based importer for Schema compliant XML files + + + + + diff --git a/org.simantics.xml.sax.ui/src/org/simantics/xml/sax/ui/wizard/ImportProcessPage.java b/org.simantics.xml.sax.ui/src/org/simantics/xml/sax/ui/wizard/ImportProcessPage.java new file mode 100644 index 0000000..33cee37 --- /dev/null +++ b/org.simantics.xml.sax.ui/src/org/simantics/xml/sax/ui/wizard/ImportProcessPage.java @@ -0,0 +1,111 @@ +package org.simantics.xml.sax.ui.wizard; + +import java.lang.reflect.InvocationTargetException; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.simantics.utils.ui.ErrorLogger; + + +public class ImportProcessPage extends WizardPage { + private Composite composite; + + private Button button; + private Label label; + + private boolean doneImport = false; + private boolean importing = false; + + public ImportProcessPage() { + super("XML Schema conversion","Conversion Summary", null); + setPageComplete(false); + + } + + public boolean isDoneImport() { + return doneImport; + } + + @Override + public void createControl(Composite parent) { + composite = new Composite(parent, SWT.NONE); + composite.setLayout(new GridLayout(1,true)); + + Label fileLabel = new Label(composite, SWT.NONE); + fileLabel.setText("File: "); + + label = new Label(composite, SWT.NONE); + label.setText("Import has not been started."); + GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BOTTOM).grab(true, false).applyTo(label); + button = new Button(composite, SWT.PUSH); + button.setText("Import"); + GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(button); + button.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + doImport(); + + } + }); + setControl(composite); + } + + private Exception exception; + + private void doImport() { + button.setEnabled(false); + label.setText("Import started."); + importing = true; + try { + getWizard().getContainer().run(true, true, new IRunnableWithProgress() { + + @Override + public void run(final IProgressMonitor monitor) throws InvocationTargetException, + InterruptedException { + try { + + monitor.beginTask("Database import", IProgressMonitor.UNKNOWN); + final SchemaConversionWizard wizard = (SchemaConversionWizard)getWizard(); + wizard.doConversion(); + + + } catch (final Exception err) { + exception = err; + } + monitor.done(); + } + }); + } catch (InvocationTargetException err) { + exception = err; + } catch (InterruptedException err) { + exception = err; + } + if (exception != null) { + setErrorMessage("Conversion failed: " + exception.getMessage()); + ErrorLogger.defaultLogError("Schema conversion failed.",exception); + label.setText("Schema conversion failed."); + } else { + label.setText("Schema conversion done."); + } + doneImport = true; + importing = false; + setPreviousPage(null); + setPageComplete(true); + getContainer().updateButtons(); + + } + + public boolean isImporting() { + return importing; + } + +} diff --git a/org.simantics.xml.sax.ui/src/org/simantics/xml/sax/ui/wizard/InputSelectionPage.java b/org.simantics.xml.sax.ui/src/org/simantics/xml/sax/ui/wizard/InputSelectionPage.java new file mode 100644 index 0000000..80e0b37 --- /dev/null +++ b/org.simantics.xml.sax.ui/src/org/simantics/xml/sax/ui/wizard/InputSelectionPage.java @@ -0,0 +1,70 @@ +package org.simantics.xml.sax.ui.wizard; + +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.simantics.utils.ui.widgets.DirectorySelectionWidget; +import org.simantics.utils.ui.widgets.FileOrDirectorySelectionWidget; +import org.simantics.utils.ui.widgets.FileSelectionListener; +import org.simantics.utils.ui.widgets.FileSelectionWidget; + +public class InputSelectionPage extends WizardPage implements FileSelectionListener{ + + public InputSelectionPage() { + super("InputPage","Select input files and output plug-in",null); + } + + private FileSelectionWidget schemaSelection; + private FileSelectionWidget configurationSelection; + private DirectorySelectionWidget pluginSelection; + + @Override + public void createControl(Composite parent) { + Composite composite = new Composite(parent, SWT.NONE); + composite.setLayout(new GridLayout(1,false)); + GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).applyTo(composite); + + schemaSelection = new FileSelectionWidget(composite, "Schema file", SWT.OPEN); + configurationSelection = new FileSelectionWidget(composite, "Configuration file (Optional)", SWT.OPEN); + pluginSelection = new DirectorySelectionWidget(composite, "Output plug-in", SWT.SAVE); + + schemaSelection.setFilterExtensions(new String[]{"*.xsd"}); + schemaSelection.setFilterNames(new String[]{"XML schema files"}); + + configurationSelection.setFilterExtensions(new String[]{"*.xml"}); + configurationSelection.setFilterNames(new String[]{"XML files"}); + + schemaSelection.addListener(this); + pluginSelection.addListener(this); + + setControl(composite); + setPageComplete(false); + } + + @Override + public void fileSelected(FileOrDirectorySelectionWidget source, String[] filename) { + setPageComplete(schemaSelection.getFilename() != null && pluginSelection.getFilename() != null); + + } + + public String getSchemaFilename() { + if (schemaSelection.getFilename() == null ||schemaSelection.getFilename().length == 0) + return null; + return schemaSelection.getFilename()[0]; + } + + public String getConfigurationFilename() { + if (configurationSelection.getFilename() == null || configurationSelection.getFilename().length == 0) + return null; + return configurationSelection.getFilename()[0]; + } + + public String getPluginFilename() { + if (pluginSelection.getFilename() == null ||pluginSelection.getFilename().length == 0) + return null; + return pluginSelection.getFilename()[0]; + } + +} diff --git a/org.simantics.xml.sax.ui/src/org/simantics/xml/sax/ui/wizard/SchemaConversionWizard.java b/org.simantics.xml.sax.ui/src/org/simantics/xml/sax/ui/wizard/SchemaConversionWizard.java new file mode 100644 index 0000000..fae0a57 --- /dev/null +++ b/org.simantics.xml.sax.ui/src/org/simantics/xml/sax/ui/wizard/SchemaConversionWizard.java @@ -0,0 +1,63 @@ +package org.simantics.xml.sax.ui.wizard; + +import java.io.File; + +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.ui.IImportWizard; +import org.eclipse.ui.IWorkbench; +import org.simantics.xml.sax.SchemaConverter; + +public class SchemaConversionWizard extends Wizard implements IImportWizard { + +// FileSelectionPage fileselectionPage; +// FileSelectionPage configurationSelectionPage; +// DirectorySelectionPage pluginSelectionPage; + InputSelectionPage inputSelectionPage ; + ImportProcessPage importProcessPage; + + public SchemaConversionWizard() { + setWindowTitle("XML Schema conversion"); + } + + @Override + public void init(IWorkbench workbench, IStructuredSelection selection) { + // TODO Auto-generated method stub + + } + + @Override + public boolean performFinish() { + if (importProcessPage.isImporting()) + return false; + return true; + } + + + @Override + public void addPages() { +// fileselectionPage = new FileSelectionPage(); +// fileselectionPage.setFilterExtensions(new String[]{"*.xsd"}); +// fileselectionPage.setFilterNames(new String[]{"XML schema files"}); +// pluginSelectionPage = new DirectorySelectionPage(); +// addPage(fileselectionPage); +// addPage(pluginSelectionPage); + addPage(inputSelectionPage = new InputSelectionPage()); + addPage(importProcessPage = new ImportProcessPage()); + } + + public void doConversion() throws Exception { + SchemaConverter converter = new SchemaConverter(); +// File inputFile = new File(fileselectionPage.getFilename()); +// File outputPlugin = new File(pluginSelectionPage.getFilename()); + + File inputFile = new File(inputSelectionPage.getSchemaFilename()); + File configurationFile = null; + if (inputSelectionPage.getConfigurationFilename() != null) + configurationFile = new File(inputSelectionPage.getConfigurationFilename()); + File outputPlugin = new File(inputSelectionPage.getPluginFilename()); + + converter.convertSchema(inputFile,configurationFile,outputPlugin); + } + +} diff --git a/org.simantics.xml.sax/.classpath b/org.simantics.xml.sax/.classpath new file mode 100644 index 0000000..b1dabee --- /dev/null +++ b/org.simantics.xml.sax/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.simantics.xml.sax/.project b/org.simantics.xml.sax/.project new file mode 100644 index 0000000..19c884f --- /dev/null +++ b/org.simantics.xml.sax/.project @@ -0,0 +1,28 @@ + + + org.simantics.xml.sax + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.simantics.xml.sax/.settings/org.eclipse.jdt.core.prefs b/org.simantics.xml.sax/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..11f6e46 --- /dev/null +++ b/org.simantics.xml.sax/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/org.simantics.xml.sax/META-INF/MANIFEST.MF b/org.simantics.xml.sax/META-INF/MANIFEST.MF new file mode 100644 index 0000000..d8e6357 --- /dev/null +++ b/org.simantics.xml.sax/META-INF/MANIFEST.MF @@ -0,0 +1,9 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Sax parser generator +Bundle-SymbolicName: org.simantics.xml.sax +Bundle-Version: 1.0.0.qualifier +Bundle-Vendor: VTT +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Export-Package: org.simantics.xml.sax +Require-Bundle: org.simantics.utils.datastructures;bundle-version="1.1.0" diff --git a/org.simantics.xml.sax/build.properties b/org.simantics.xml.sax/build.properties new file mode 100644 index 0000000..41eb6ad --- /dev/null +++ b/org.simantics.xml.sax/build.properties @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . diff --git a/org.simantics.xml.sax/schema/XMLSchema.xsd b/org.simantics.xml.sax/schema/XMLSchema.xsd new file mode 100644 index 0000000..53458d6 --- /dev/null +++ b/org.simantics.xml.sax/schema/XMLSchema.xsd @@ -0,0 +1,2358 @@ + + + + + Part 1 version: Id: structures.xsd,v 1.2 2004/01/15 11:34:25 ht Exp + Part 2 version: Id: datatypes.xsd,v 1.3 2004/01/23 18:11:13 ht Exp + + + + + + The schema corresponding to this document is normative, + with respect to the syntactic constraints it expresses in the + XML Schema language. The documentation (within <documentation> elements) + below, is not normative, but rather highlights important aspects of + the W3C Recommendation of which this is a part + + + + + The simpleType element and all of its members are defined + towards the end of this schema document + + + + + + Get access to the xml: attribute groups for xml:lang + as declared on 'schema' and 'documentation' below + + + + + + + + This type is extended by almost all schema types + to allow attributes from other namespaces to be + added to user schemas. + + + + + + + + + + + + + This type is extended by all types which allow annotation + other than <schema> itself + + + + + + + + + + + + + + + + This group is for the + elements which occur freely at the top level of schemas. + All of their types are based on the "annotated" type by extension. + + + + + + + + + + + + + This group is for the + elements which can self-redefine (see <redefine> below). + + + + + + + + + + + + + A utility type, not for public use + + + + + + + + + + + A utility type, not for public use + + + + + + + + + + + A utility type, not for public use + + #all or (possibly empty) subset of {extension, restriction} + + + + + + + + + + + + + + + + + A utility type, not for public use + + + + + + + + + + + + + A utility type, not for public use + + #all or (possibly empty) subset of {extension, restriction, list, union} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + for maxOccurs + + + + + + + + + + + + for all particles + + + + + + + for element, group and attributeGroup, + which both define and reference + + + + + + + + 'complexType' uses this + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This branch is short for + <complexContent> + <restriction base="xs:anyType"> + ... + </restriction> + </complexContent> + + + + + + + + + + + + + + + Will be restricted to required or forbidden + + + + + + Not allowed if simpleContent child is chosen. + May be overriden by setting on complexContent child. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This choice is added simply to + make this a valid restriction per the REC + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Overrides any setting on complexType parent. + + + + + + + + + + + + + + + This choice is added simply to + make this a valid restriction per the REC + + + + + + + + + + + + + + + + + No typeDefParticle group reference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A utility type, not for public use + + #all or (possibly empty) subset of {substitution, extension, + restriction} + + + + + + + + + + + + + + + + + + + + + + + + + The element element can be used either + at the top level to define an element-type binding globally, + or within a content model to either reference a globally-defined + element or type or declare an element-type binding locally. + The ref form is not allowed at the top level. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + group type for explicit groups, named top-level groups and + group references + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + group type for the three kinds of group + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This choice with min/max is here to + avoid a pblm with the Elt:All/Choice/Seq + Particle derivation constraint + + + + + + + + + + restricted max/min + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Only elements allowed inside + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + simple type for the value of the 'namespace' attr of + 'any' and 'anyAttribute' + + + + Value is + ##any - - any non-conflicting WFXML/attribute at all + + ##other - - any non-conflicting WFXML/attribute from + namespace other than targetNS + + ##local - - any unqualified non-conflicting WFXML/attribute + + one or - - any non-conflicting WFXML/attribute from + more URI the listed namespaces + references + (space separated) + + ##targetNamespace or ##local may appear in the above list, to + refer to the targetNamespace of the enclosing + schema or an absent targetNamespace respectively + + + + + + A utility type, not for public use + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A subset of XPath expressions for use +in selectors + A utility type, not for public +use + + + + The following pattern is intended to allow XPath + expressions per the following EBNF: + Selector ::= Path ( '|' Path )* + Path ::= ('.//')? Step ( '/' Step )* + Step ::= '.' | NameTest + NameTest ::= QName | '*' | NCName ':' '*' + child:: is also allowed + + + + + + + + + + + + + + + + + + + + + + + A subset of XPath expressions for use +in fields + A utility type, not for public +use + + + + The following pattern is intended to allow XPath + expressions per the same EBNF as for selector, + with the following change: + Path ::= ('.//')? ( Step '/' )* ( Step | '@' NameTest ) + + + + + + + + + + + + + + + + + + + + + + + + + + + The three kinds of identity constraints, all with + type of or derived from 'keybase'. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A utility type, not for public use + + A public identifier, per ISO 8879 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + notations for use within XML Schema schemas + + + + + + + + + Not the real urType, but as close an approximation as we can + get in the XML representation + + + + + + + + + + First the built-in primitive datatypes. These definitions are for + information only, the real built-in definitions are magic. + + + + For each built-in datatype in this schema (both primitive and + derived) can be uniquely addressed via a URI constructed + as follows: + 1) the base URI is the URI of the XML Schema namespace + 2) the fragment identifier is the name of the datatype + + For example, to address the int datatype, the URI is: + + http://www.w3.org/2001/XMLSchema#int + + Additionally, each facet definition element can be uniquely + addressed via a URI constructed as follows: + 1) the base URI is the URI of the XML Schema namespace + 2) the fragment identifier is the name of the facet + + For example, to address the maxInclusive facet, the URI is: + + http://www.w3.org/2001/XMLSchema#maxInclusive + + Additionally, each facet usage in a built-in datatype definition + can be uniquely addressed via a URI constructed as follows: + 1) the base URI is the URI of the XML Schema namespace + 2) the fragment identifier is the name of the datatype, followed + by a period (".") followed by the name of the facet + + For example, to address the usage of the maxInclusive facet in + the definition of int, the URI is: + + http://www.w3.org/2001/XMLSchema#int.maxInclusive + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NOTATION cannot be used directly in a schema; rather a type + must be derived from it by specifying at least one enumeration + facet whose value is the name of a NOTATION declared in the + schema. + + + + + + + + + + Now the derived primitive types + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pattern specifies the content of section 2.12 of XML 1.0e2 + and RFC 3066 (Revised version of RFC 1766). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pattern matches production 7 from the XML spec + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pattern matches production 5 from the XML spec + + + + + + + + + + + + + + + pattern matches production 4 from the Namespaces in XML spec + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A utility type, not for public use + + + + + + + + + + + + + + + + + + + + + + #all or (possibly empty) subset of {restriction, union, list} + + + A utility type, not for public use + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Can be restricted to required or forbidden + + + + + + + + + + + + + + + + + + Required at the top level + + + + + + + + + + + + + + + + + + + Forbidden when nested + + + + + + + + + + + + + + + + + + + We should use a substitution group for facets, but + that's ruled out because it would allow users to + add their own, which we're not ready for yet. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + base attribute and simpleType child are mutually + exclusive, but one or other is required + + + + + + + + + + + + + + + + itemType attribute and simpleType child are mutually + exclusive, but one or other is required + + + + + + + + + + + + + + + + + + memberTypes attribute must be non-empty or there must be + at least one simpleType child + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/org.simantics.xml.sax/schema/configuration.xsd b/org.simantics.xml.sax/schema/configuration.xsd new file mode 100644 index 0000000..81930e6 --- /dev/null +++ b/org.simantics.xml.sax/schema/configuration.xsd @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/org.simantics.xml.sax/schema/gen.bat b/org.simantics.xml.sax/schema/gen.bat new file mode 100644 index 0000000..ce18e92 --- /dev/null +++ b/org.simantics.xml.sax/schema/gen.bat @@ -0,0 +1 @@ +"c:\Program Files\Java\jdk1.8.0_60\bin\xjc" -d ../src configuration.xsd diff --git a/org.simantics.xml.sax/src/org/simantics/xml/sax/ImporterGenerator.java b/org.simantics.xml.sax/src/org/simantics/xml/sax/ImporterGenerator.java new file mode 100644 index 0000000..cff87ed --- /dev/null +++ b/org.simantics.xml.sax/src/org/simantics/xml/sax/ImporterGenerator.java @@ -0,0 +1,1008 @@ +package org.simantics.xml.sax; + +import java.io.File; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.xml.namespace.QName; + +import org.simantics.utils.datastructures.BijectionMap; +import org.simantics.utils.datastructures.Pair; +import org.simantics.xml.sax.configuration.AttributeComposition; +import org.simantics.xml.sax.configuration.Configuration; +import org.simantics.xml.sax.configuration.IDProvider; +import org.simantics.xml.sax.configuration.IDReference; +import org.simantics.xml.sax.configuration.UnrecognizedChildElement; +import org.w3._2001.xmlschema.Annotated; +import org.w3._2001.xmlschema.Attribute; +import org.w3._2001.xmlschema.AttributeGroup; +import org.w3._2001.xmlschema.AttributeGroupRef; +import org.w3._2001.xmlschema.ComplexType; +import org.w3._2001.xmlschema.Element; +import org.w3._2001.xmlschema.LocalComplexType; +import org.w3._2001.xmlschema.LocalSimpleType; +import org.w3._2001.xmlschema.NamedAttributeGroup; +import org.w3._2001.xmlschema.OpenAttrs; +import org.w3._2001.xmlschema.Restriction; +import org.w3._2001.xmlschema.Schema; +import org.w3._2001.xmlschema.SimpleType; +import org.w3._2001.xmlschema.TopLevelAttribute; + +public class ImporterGenerator extends SchemaConversionBase{ + + public ImporterGenerator(Configuration configuration) { + super(configuration); + } + + String commentTag = "//"; + + Schema schema; + String ontologyClassName; + SchemaConverter converter; + + List ruleClassNames = new ArrayList(); + + String ontShort = "ONT"; + + File importParserDir; + String elementPackageName; + + public void createParser(Schema schema,String className, SchemaConverter converter) throws IOException { + this.schema = schema; + this.ontologyClassName = className; + this.converter = converter; + + + String packageParts[] = className.split("\\."); + String name = packageParts[packageParts.length-1]; + + + ontShort = name.substring(0, 3).toUpperCase(); + ontShort +="."; + String parserPackagePostfix = "_elem"; + String importerClassPostfix = "Importer"; + elementPackageName = name+parserPackagePostfix; + + importParserDir= new File(converter.getParserDir().getAbsolutePath()+"/"+elementPackageName); + if (!importParserDir.exists()) + importParserDir.mkdirs(); + + handle(schema); + + File importParserFile = new File(converter.getParserDir().getAbsolutePath()+"/"+name+importerClassPostfix+".java"); + PrintWriter mainWriter = createFile(importParserFile); + mainWriter.println("package " + converter.getPluginName() +";"); + mainWriter.println(); + mainWriter.println("import java.io.File;"); + mainWriter.println("import org.simantics.db.Session;"); + mainWriter.println("import org.simantics.xml.sax.base.AbstractImporter;"); + mainWriter.println("import org.simantics.xml.sax.base.XMLParser;"); + mainWriter.println(); + mainWriter.println("public class " + name + importerClassPostfix+" extends AbstractImporter {"); + mainWriter.println(); + mainWriter.println(" public " + name + importerClassPostfix+"(Session session, File file) {"); + mainWriter.println(" super(session,file);"); + mainWriter.println(" }"); + mainWriter.println(); + mainWriter.println(" @Override"); + mainWriter.println(" public void configure(XMLParser parser) {"); + for (String s : ruleClassNames) { + mainWriter.println(" parser.add(new "+s+"());"); + } + mainWriter.println(" }"); + mainWriter.println("}"); + + mainWriter.println(); + mainWriter.flush(); + mainWriter.close(); + } + + protected PrintWriter createFile(File file) throws IOException { + if (!file.exists()) + file.createNewFile(); + PrintWriter writer = new PrintWriter(file); + for (String s : converter.getHeader()) { + writer.println(commentTag + " " + s); + } + writer.println(); + return writer; + } + + protected String getValueGetter(String binding,String name) { + if (binding == null) + return name+".getValue()"; + if ("STRING".equals(binding)) + return name+".getValue()"; + if ("BOOLEAN".equals(binding)) + return "Boolean.parseBoolean("+name+".getValue())"; + if ("INTEGER".equals(binding)) + return "Integer.parseInt("+name+".getValue())"; + if ("DOUBLE".equals(binding)) + return "Double.parseDouble("+name+".getValue())"; + if ("FLOAT".equals(binding)) + return "Float.parseFloat("+name+".getValue())"; + return name+".getValue()"; + } + + protected String getValueGetter(String binding) { + if (binding == null) + return "value"; + if ("STRING".equals(binding)) + return "value"; + if ("BOOLEAN".equals(binding)) + return "Boolean.parseBoolean(value)"; + if ("INTEGER".equals(binding)) + return "Integer.parseInt(value)"; + if ("DOUBLE".equals(binding)) + return "Double.parseDouble(value)"; + if ("FLOAT".equals(binding)) + return "Float.parseFloat(value)"; + return "value"; + } + + protected void handle(TopLevelAttribute topLevelAttribute) { + + } + + + + public static String getComplexTypePrefix() { + return "ComplexTypes_"; + } + + public static String getAttributeGroupPrefix() { + return "AttributeGroups_"; + } + + private Map writers = new HashMap(); + @Override + protected void handleComplexType(SchemaObject complexTypeObj) { + ComplexType topLevelComplexType = complexTypeObj.getComplexType(); + + String name = getName(complexTypeObj);//topLevelComplexType.getName(); + + String className = name;//"_"+name; + + FileWriter fw = new FileWriter(); + try { + fw.writer = createFile(new File(importParserDir.getAbsolutePath()+"/"+className+".java")); + } catch (IOException e) { + throw new RuntimeException(e); + } + writers.put(complexTypeObj, fw); + + boolean isList = false; + + String baseClass = "org.simantics.xml.sax.base.XMLElementNamedChildParserBase"; + + boolean inherited = false; + + QName type = getComplexTypeBase(topLevelComplexType); + if (type != null && !type.getNamespaceURI().equals("http://www.w3.org/2001/XMLSchema")) { + baseClass = getName(complexTypeName.get(type.getLocalPart())); + inherited = true; + } + + provider = getIDProvider(topLevelComplexType); + List references = getIDReferences(topLevelComplexType); + UnrecognizedChildElement unknownChildElement = getUnknown(topLevelComplexType); + + List intrerfaces = new ArrayList(); + if (references.size() > 0) + intrerfaces.add("org.simantics.xml.sax.base.IDReferenceParser"); + if (unknownChildElement != null) + intrerfaces.add("org.simantics.xml.sax.base.UnrecognizedElementParser"); + + createClassHeader(fw.writer, isList); + writeClass(fw.writer,true, null, className, baseClass, intrerfaces); + + writeIDProvider(fw.writer); + + fw.writer.println(" @Override"); + fw.writer.println(" public Resource create(WriteGraph graph, Element element) throws DatabaseException{"); + fw.writer.println(" Layer0 L0 = Layer0.getInstance(graph);"); + fw.writer.println(" "+getOntologyImport()); + if (!isList) { + fw.writer.println(" Resource res = graph.newResource();"); + fw.writer.println(" graph.claim(res, L0.InstanceOf, "+ontShort+name+");"); + } else { + fw.writer.println(" Resource res = ListUtils.create(graph, "+ontShort+name+", Collections.EMPTY_LIST);"); + } + fw.writer.println(" return res;"); + fw.writer.println(" }"); + fw.writer.println(); + + fw.writer.println(" @Override"); + fw.writer.println(" public boolean connectParent(WriteGraph graph, Element parent, Element element) throws DatabaseException{"); + fw.writer.println(" "+getOntologyImport()); + fw.writer.println(" graph.claim(parent.getData(), "+this.ontShort+getName(complexTypeObj,"has")+", element.getData());"); + fw.writer.println(" return true;"); + fw.writer.println(" }"); + fw.writer.println(); + + StringWriter stringWriter = new StringWriter(); + fw.delayedWriter = new PrintWriter(stringWriter); + StringWriter stringWriter2 = new StringWriter(); + fw.delayedWriter2 = new PrintWriter(stringWriter2); + + fw.writer.println(" public " + className + "() {"); + fw.writer.println(" super();"); + + handleComplexTypeExtension(complexTypeObj); + + fw.writer.println(" }"); + + fw.writer.println(" @Override"); + fw.writer.println(" public boolean connectChild(WriteGraph graph, Element element, Element child) throws DatabaseException{"); + fw.writer.println(" "+getOntologyImport()); + + if (stringWriter.getBuffer().length() > 0) { + fw.writer.write(stringWriter.toString()); + } + + + fw.writer.println(" return false;"); + fw.writer.println(" }"); + fw.writer.println(); + + if (stringWriter2.getBuffer().length() > 0) { + fw.writer.write(stringWriter2.toString()); + } + + stringWriter = null; + fw.delayedWriter.close(); + fw.delayedWriter=null; + stringWriter2 = null; + fw.delayedWriter2.close(); + fw.delayedWriter2 = null; + + fw.writer.println(" @Override"); + fw.writer.println(" public void configure(WriteGraph graph, Deque parents, Element element) throws DatabaseException {"); + if (inherited) { + fw.writer.println(" super.configure(graph,parents,element);"); + } + fw.writer.println(" "+getOntologyImport()); + + handleComplexTypeAttributes(complexTypeObj); + handleExtensionAttributes(complexTypeObj); + + fw.writer.println(" }"); + + writeIDReferences(fw.writer,name, references); + writeUnknownChild(fw.writer,name,unknownChildElement); + + fw.writer.println("}"); + fw.writer.println(); + fw.writer.flush(); + fw.writer.close(); + fw.writer = null; + writers.remove(complexTypeObj); + provider = null; + } + + @Override + protected void handle(SchemaObject parent, SchemaElement indicator, List elements) { + if (indicator.getType() == SchemaElement.ElementType.SEQUENCE || (indicator.getType() == SchemaElement.ElementType.CHOICE && indicator.getRestriction().many())) { + for (SchemaElement e : elements) { + handle(parent, indicator, e); + } + } else if (indicator.getType() == SchemaElement.ElementType.CHOICE) { + String name = getChoiceName(elements); + + for (SchemaElement e : elements) { + Element localElement = e.getElement(); + if (localElement.getName() != null) { + QName refType = localElement.getType(); + if (refType != null) + handleIndicator(parent, indicator, e, false, name, refType); + } else if (localElement.getRef() != null) { + QName refType = localElement.getRef(); + handleIndicator(parent, indicator, e, true, name, refType); + } + } + } + + } + + @Override + protected void handleIndicator(SchemaObject parent, SchemaElement indicator, SchemaElement element, boolean reference, String ref, QName refType) { + FileWriter fw = getWriter(parent); + String binding = getBindingFromPrimitiveType(refType); + if (binding == null) { + SchemaObject refElement = elementName.get(refType.getLocalPart()); + SchemaObject refComplexType = complexTypeName.get(refType.getLocalPart()); +// String className = refType.getLocalPart(); +// if (!isElementRef(refType.getLocalPart())) { +// className = "_"+className; +// } +// +// String refClassName = refType.getLocalPart(); +// if (isComplexTypeRef(refClassName)) { +// refClassName = "_"+refClassName; +// } + String className = null; + String refClassName = null; + if (refElement != null) + className = getName(refElement); + else + className = getName(refComplexType); + + if (refComplexType != null) { + refClassName = getName(refComplexType); + } else { + refClassName = getName(refElement); + } + + if (!reference) + fw.writer.println(" addParser(\""+ ref +"\", "+className+".class);"); + else + fw.writer.println(" addParser("+className+".class);"); + if (!className.equals(refClassName)) + fw.writer.println(" addParser("+refClassName+".class);"); + + fw.delayedWriter.println(" if (child.getParser() instanceof "+refClassName+"){"); + fw.delayedWriter.println(" graph.claim(element.getData(), "+ontShort+getName(parent)+"_has"+ref + ", child.getData());"); + if (useElementList(parent, indicator,element, reference, ref, refType)) { + + // element type specific list + fw.delayedWriter.println(" {"); + fw.delayedWriter.println(" Resource list = graph.getPossibleObject(element.getData(),"+ontShort+getName(parent)+"_has"+ref + "List);"); + fw.delayedWriter.println(" if (list == null) {"); + fw.delayedWriter.println(" list = org.simantics.db.common.utils.ListUtils.create(graph, java.util.Collections.singletonList(child.getData()));"); + fw.delayedWriter.println(" graph.claim(element.getData(),"+ontShort+getName(parent)+"_has"+ref + "List,list);"); + fw.delayedWriter.println(" } else {"); + fw.delayedWriter.println(" org.simantics.db.common.utils.ListUtils.insertBack(graph, list, java.util.Collections.singletonList(child.getData()));"); + fw.delayedWriter.println(" }"); + fw.delayedWriter.println(" }"); + } + if (useOriginalList(parent, indicator,element, reference, ref, refType)) { + // generic list + fw.delayedWriter.println(" {"); + fw.delayedWriter.println(" Resource list = graph.getPossibleObject(element.getData(),"+ontShort+"XML_hasOriginalElementList);"); + fw.delayedWriter.println(" if (list == null) {"); + fw.delayedWriter.println(" list = org.simantics.db.common.utils.ListUtils.create(graph, java.util.Collections.singletonList(child.getData()));"); + fw.delayedWriter.println(" graph.claim(element.getData(),"+ontShort+"XML_hasOriginalElementList,list);"); + fw.delayedWriter.println(" } else {"); + fw.delayedWriter.println(" org.simantics.db.common.utils.ListUtils.insertBack(graph, list, java.util.Collections.singletonList(child.getData()));"); + fw.delayedWriter.println(" }"); + fw.delayedWriter.println(" }"); + } + + fw.delayedWriter.println(" return true;"); + fw.delayedWriter.println(" }"); + } else { + //writer.println(commentTag+ontShort+"."+parent+".has"+ref + " getParser(java.util.Map parsers, Element element, Element child) {"); + fw.delayedWriter2.println(" Class parserClass = super.getParser(parsers, element, child);"); + fw.delayedWriter2.println(" if (parserClass != null) return parserClass;"); + fw.delayedWriter2.println(" org.simantics.xml.sax.base.XMLElementParser parser = parsers.get(child.getQName());"); + fw.delayedWriter2.println(" if (parser != null) return parser.getClass();"); + fw.delayedWriter2.println(" return null;"); + fw.delayedWriter2.println(" }"); + } + + private FileWriter getWriter(SchemaObject obj) { + SchemaObject s = obj; + while (s != null) { + FileWriter fw = writers.get(s); + if (fw != null) + return fw; + s = s.getParent(); + } + return null; + } + + + @Override + protected void handle(SchemaObject parent, Attribute attribute) { + String name = attribute.getName(); + QName primitiveType = attribute.getType(); + SimpleType simpleType = attribute.getSimpleType(); + QName ref = attribute.getRef(); + + String relationName; + String attrName; + if (name != null) { + attrName = name; + relationName = ontShort+"has"+name; + if (parent != null) + relationName = ontShort+getName(parent)+"_has"+name; + } + else if (ref != null && parent != null) { + attrName = ref.getLocalPart(); + relationName = ontShort+getName(parent)+"_has"+ref.getLocalPart(); + + Attribute referred = getRefAttribute(ref); + if (referred != null) { + primitiveType = referred.getType(); + simpleType = referred.getSimpleType(); + } + + } else { + throw new RuntimeException(); + } + boolean isReference = false; + if (provider!= null && provider.getAttribute().getName().equals(attrName)) + isReference = true; + + FileWriter fw = getWriter(parent); + if (primitiveType != null) { + + String binding = getBindingFromPrimitiveType(primitiveType); + + if (binding != null) { + writeAttribute(fw, attrName, relationName, binding, isReference); + return; + } else { + if (simpleType == null) { + SchemaObject simpleTypeObj = simpleTypeName.get(primitiveType.getLocalPart()); + if (simpleTypeObj != null) + simpleType = simpleTypeObj.getSimpleType(); + } + } + } + if (simpleType != null) { + Restriction restriction = simpleType.getRestriction(); + if (restriction == null) + throw new RuntimeException("Cannot resolve type for Attribute " + attrName + " -> " + primitiveType.getLocalPart()+ ", SimpleType restriction is unset"); + QName base = restriction.getBase(); + + + String binding = getBindingFromPrimitiveType(base); + writeAttribute(fw, attrName, relationName, binding, isReference); + } else { + throw new RuntimeException("Cannot resolve type for Attribute " + attrName + " -> " + primitiveType.getLocalPart()); + } + } + + private void writeAttribute(FileWriter fw, String attrName, String relationName, String binding, boolean isReference) { + fw.writer.println(" {"); + fw.writer.println(" Attribute a = element.getAttribute(\"" +attrName+"\");"); + fw.writer.println(" if (a != null) {"); + fw.writer.println(" graph.claimLiteral(element.getData(),"+relationName+","+getValueGetter(binding,"a")+", Bindings."+binding+");"); + if (isReference) + fw.writer.println(" idProviderValue = a.getValue();"); + fw.writer.println(" }"); + fw.writer.println(" }"); + } + + @Override + protected void handleAttributes(SchemaObject simpleTypeObj) { + SchemaObject parent = simpleTypeObj.getParent(); + FileWriter fw = getWriter(parent); + + SimpleType simpleType = simpleTypeObj.getSimpleType(); + Restriction restriction = simpleType.getRestriction(); + if (restriction == null) + throw new RuntimeException("Cannot resolve type for Element " + getName(parent)); + QName base = restriction.getBase(); + + + String binding = getBindingFromPrimitiveType(base); + fw.writer.println(" @Override"); + fw.writer.println(" public void configure(WriteGraph graph, Element element, java.lang.String value) throws DatabaseException {"); + fw.writer.println(" graph.claimValue(element.getData(),"+getValueGetter(binding)+", Bindings."+binding+");"); + fw.writer.println(" }"); + + } + + @Override + protected void handle(SchemaObject parent, AttributeGroup attribute) { + if (parent != null) { + FileWriter fw = getWriter(parent); + NamedAttributeGroup group = getAttributeGroup(attribute.getRef().getLocalPart()); + fw.writer.println(commentTag+" AttributeGroup " + group.getName()); + SchemaObject obj = new SchemaObject(parent,attribute); + for (Annotated annotated : group.getAttributeOrAttributeGroup()) { + if (annotated instanceof Attribute) { + //handle("AttributeGroups_"+group.getName(),(Attribute)annotated); + handle(obj,(Attribute)annotated); + } else if (annotated instanceof AttributeGroup) { + //handle("AttributeGroups_"+group.getName(),(AttributeGroup)annotated); + handle(obj,(AttributeGroup)annotated); + } + } + fw.writer.println(commentTag+" End of AttributeGroup " + group.getName()); + } + + } + + @Override + protected void handleAttributeComposition(SchemaObject parent, AttributeComposition composition, BijectionMap attributes) { + FileWriter fw = getWriter(parent); + QName type = new QName(CONVERSION_NS, composition.getType()); + String arrayBinding = getBindingFromPrimitiveType(type); + String javaType = getJavaTypeFromPrimitiveType(type); + String name = composition.getName(); + + String relationName; + if (name != null) { + relationName = ontShort+"has"+name; + if (parent != null) + relationName = ontShort+getName(parent)+"_has"+name; + } else { + throw new RuntimeException(); + } + + fw.writer.println(" {"); + int i = 0; + for (org.simantics.xml.sax.configuration.Attribute a : composition.getAttribute()) + fw.writer.println(" Attribute a"+(i++)+" = element.getAttribute(\"" +a.getName()+"\");"); + fw.writer.print (" "+javaType + " value = new "+javaType+"{"); + i = 0; + // FIXME : handle optional attributes properly. + for (org.simantics.xml.sax.configuration.Attribute a : composition.getAttribute()) { + Attribute attribute = ((Attribute)attributes.getRight(a)); + QName atype = getBaseType(attribute); + String defaultValue = attribute.getDefault(); + if (defaultValue == null) + defaultValue = getDefaultValue(atype); + + String binding = getBindingFromPrimitiveType(atype); + if (i > 0) + fw.writer.print(","); + if (defaultValue != null) + fw.writer.print("a"+(i)+"!= null ? "+ getValueGetter(binding,"a"+(i++)) + " : " +defaultValue); + else + fw.writer.print(getValueGetter(binding,"a"+(i++))); + } + fw.writer.println("};"); + fw.writer.println(" graph.claimLiteral(element.getData(),"+relationName+", value, Bindings."+arrayBinding+");"); + fw.writer.println(" }"); + + } + + protected String getDefaultValue(QName atype) { + Map types = typeMap.get(atype.getNamespaceURI()); + if (types == null) + return null; + TypeEntry entry = types.get(atype.getLocalPart()); + if (entry == null) + return null; + return entry.defaultValue; + } + + + @Override + protected void handleSimpleType(SchemaObject parent, SchemaObject simpleType) { + + } + + + + IDProvider provider; + @Override + protected void handleElement(SchemaObject elementObj) { + Element element = elementObj.getElement(); + + String name = getName(elementObj);//topLevelElement.getName(); + String className = name; + + FileWriter fw = new FileWriter(); + try { + fw.writer = createFile(new File(importParserDir.getAbsolutePath()+"/"+className+".java")); + } catch (IOException e) { + throw new RuntimeException(e); + } + writers.put(elementObj, fw); + boolean isList = false; + + Pair inhertiance = getElementInheritance(elementObj); + boolean inherited = inhertiance.second; + String baseClass = inhertiance.first;//"org.simantics.xml.sax.base.XMLElementParserBase"; + + + provider = getIDProvider(element); + List references = getIDReferences(element); + UnrecognizedChildElement unknownChildElement = getUnknown(element); + + List intrerfaces = new ArrayList(); + if (references.size() > 0) + intrerfaces.add("org.simantics.xml.sax.base.IDReferenceParser"); + if (unknownChildElement != null) + intrerfaces.add("org.simantics.xml.sax.base.UnrecognizedElementParser"); + + createClassHeader(fw.writer, isList); + writeClass(fw.writer,false, element.getName(), className, baseClass, intrerfaces); + writeIDProvider(fw.writer); + fw.writer.println(" @Override"); + fw.writer.println(" public Resource create(WriteGraph graph, Element element) throws DatabaseException{"); + fw.writer.println(" Layer0 L0 = Layer0.getInstance(graph);"); + fw.writer.println(" "+getOntologyImport()); + if (!isList) { + fw.writer.println(" Resource res = graph.newResource();"); + fw.writer.println(" graph.claim(res, L0.InstanceOf, "+ontShort+name+");"); + } else { + fw.writer.println(" Resource res = ListUtils.create(graph, "+ontShort+name+", Collections.EMPTY_LIST);"); + } + fw.writer.println(" return res;"); + fw.writer.println(" }"); + fw.writer.println(); + + fw.writer.println(" @Override"); + fw.writer.println(" public boolean connectParent(WriteGraph graph, Element parent, Element element) throws DatabaseException{"); + fw.writer.println(" "+getOntologyImport()); + fw.writer.println(" graph.claim(parent.getData(), "+this.ontShort+getName(elementObj,"has")+", element.getData());"); + fw.writer.println(" return true;"); + fw.writer.println(" }"); + fw.writer.println(); + + fw.writer.println(" @Override"); + fw.writer.println(" public void configure(WriteGraph graph, Deque parents, Element element) throws DatabaseException {"); + if (inherited) { + fw.writer.println(" super.configure(graph,parents,element);"); + } + fw.writer.println(" "+getOntologyImport()); + + LocalComplexType complexType = element.getComplexType(); + LocalSimpleType simpleType = element.getSimpleType(); + + if (complexType != null) { + SchemaObject obj = complexTypes.get(complexType); + handleElementComplexTypeAttributes(obj); + } + fw.writer.println(" }"); + + if (simpleType != null) { + SchemaObject obj = simpleTypes.get(simpleType); + handleElementSimpleTypeAttributes(obj); + } + + + StringWriter stringWriter = new StringWriter(); + fw.delayedWriter = new PrintWriter(stringWriter); + StringWriter stringWriter2 = new StringWriter(); + fw.delayedWriter2 = new PrintWriter(stringWriter2); + + fw.writer.println(" public " + className + "() {"); + fw.writer.println(" super();"); + + if (complexType != null) { + SchemaObject obj = complexTypes.get(complexType); + handleComplexTypeExtension(obj); + } else if (simpleType != null) { + + } + + fw.writer.println(" }"); + + fw.writer.println(" @Override"); + fw.writer.println(" public boolean connectChild(WriteGraph graph, Element element, Element child) throws DatabaseException{"); + fw.writer.println(" "+getOntologyImport()); + + if (stringWriter.getBuffer().length() > 0) { + fw.writer.write(stringWriter.toString()); + } + if (inherited) { + fw.writer.println(" return super.connectChild(graph,element,child);"); + } else { + fw.writer.println(" return false;"); + } + fw.writer.println(" }"); + fw.writer.println(); + + if (stringWriter2.getBuffer().length() > 0) { + fw.writer.write(stringWriter2.toString()); + } + + stringWriter = null; + fw.delayedWriter.close(); + fw.delayedWriter = null; + stringWriter2 = null; + fw.delayedWriter2.close(); + fw.delayedWriter2 = null; + + writeIDReferences(fw.writer,name, references); + writeUnknownChild(fw.writer,name,unknownChildElement); + + fw.writer.println("}"); + fw.writer.println(); + fw.writer.flush(); + fw.writer.close(); + fw.writer = null; + writers.remove(elementObj); + provider = null; + + ruleClassNames.add(converter.getPluginName()+"."+elementPackageName+"."+name); + } + + private Pair getElementInheritance(SchemaObject topLevelElementObj) { + Element topLevelElement = topLevelElementObj.getElement(); + String baseClass = "org.simantics.xml.sax.base.XMLElementNamedChildParserBase"; + boolean inherited = false; + if (topLevelElement.getType() != null) { + QName type = topLevelElement.getType(); + if (!type.getNamespaceURI().equals(SCHEMA_NS)) { + SchemaObject obj = complexTypeName.get(type.getLocalPart()); + baseClass = getName(obj); + inherited = true; + } + } + if (!inherited) { + QName type = getElementBase(topLevelElement); + if (type != null) { + if (!type.getNamespaceURI().equals(SCHEMA_NS)) { + SchemaObject obj = getWithName(topLevelElementObj, type.getLocalPart()); + baseClass = getName(obj); + inherited = true; + } + } + } + if (!inherited) { + QName type = topLevelElement.getSubstitutionGroup(); + if (type != null) { + if (!type.getNamespaceURI().equals(SCHEMA_NS)) { + SchemaObject obj = getWithName(topLevelElementObj, type.getLocalPart()); + baseClass = getName(obj); + inherited = true; + } + } + } + + return new Pair(baseClass, inherited); + } + + private void writeClass(PrintWriter writer,boolean abst, String name, String className, String baseClass, List interfaces) { + writer.println("@SuppressWarnings(\"unused\")"); + writer.print("public " +(abst ? "abstract " : "") + "class " + className + " extends "+baseClass); + if (interfaces.size() > 0) { + writer.print(" implements "); + for (int i = 0; i < interfaces.size(); i++) { + writer.print(interfaces.get(i)); + if (i < interfaces.size() -1 ) + writer.print(","); + } + } + writer.println("{"); + writer.println(); + writer.println(" @Override"); + writer.println(" public java.lang.String getElementId() {"); + if (name != null) + writer.println(" return \""+name+"\";"); + else // complex types cannot be parsed directly with name/id reference. + writer.println(" return null;"); + writer.println(" }"); + writer.println(); + } + + private void writeIDProvider(PrintWriter writer) { + if (provider != null) { + writer.println(" java.lang.String idProviderValue = null;"); + writer.println(); + writer.println(" @Override"); + writer.println(" public java.lang.String getID() {"); + writer.println(" java.lang.String s = idProviderValue;"); + writer.println(" idProviderValue = null;"); + writer.println(" return s;"); + writer.println(" }"); + writer.println(); + if (provider.getPriority() != null) { + writer.println(" @Override"); + writer.println(" public int idPriority() {"); + writer.println(" return " + provider.getPriority().intValue()+";"); + writer.println(" }"); + } + } + } + + private void writeIDReferences(PrintWriter writer,String name, List references) { + if (references.size() > 0) { + writer.println(" @Override"); + writer.println(" public boolean connectReferences(WriteGraph graph, Element element, java.util.Map map) throws DatabaseException {"); + writer.println(" "+getOntologyImport()); + writer.println(" boolean result = true;"); + for (IDReference ref : references) { + writer.println(" {"); + writer.println(" Attribute a = element.getAttribute(\"" + ref.getIDSource().getName() +"\");"); + writer.println(" if (a != null) {"); + writer.println(" Element refEle = map.get(a.value);"); + writer.println(" if (refEle != null) {"); + writer.println(" Resource ref = refEle.getData();"); + writer.println(" graph.claim(element.getData(), "+ontShort+name+"_"+ref.getReference().getName()+", ref);"); + writer.println(" } else {"); + writer.println(" result = false;"); + writer.println(" }"); + writer.println(" }"); + writer.println(" }"); + } + writer.println(" return result;"); + writer.println(" }"); + writer.println(); + } + } + + private void writeUnknownChild(PrintWriter writer,String name, UnrecognizedChildElement unknownChildElement) { + if (unknownChildElement == null) + return; + + writer.println(" @Override"); + writer.println(" public void configureChild(WriteGraph graph, Deque parents, Element element, Element child) throws DatabaseException {"); + writer.println(" " + unknownChildElement.getJavaMethod()); + writer.println(" }"); + writer.println(); + + } + + protected void createClassHeader(PrintWriter writer, boolean isList) { + writer.println("package " + converter.getPluginName() +"."+elementPackageName+";"); + writer.println(); + writer.println("import java.util.Deque;"); + writer.println("import org.simantics.databoard.Bindings;"); + writer.println("import org.simantics.db.Resource;"); + writer.println("import org.simantics.db.WriteGraph;"); + writer.println("import org.simantics.db.exception.DatabaseException;"); + writer.println("import org.simantics.xml.sax.base.Attribute;"); + writer.println("import org.simantics.xml.sax.base.Element;"); + if (!isList) { + writer.println("import org.simantics.layer0.Layer0;"); + } else { + writer.println("import java.util.Collections;"); + writer.println("import org.simantics.db.common.utils.ListUtils;"); + } + writer.println(); + } + + private String getOntologyImport() { + return this.ontologyClassName+" " +ontShort.substring(0, 3)+" = "+this.ontologyClassName+".getInstance(graph);"; + } + + + private static class FileWriter { + public PrintWriter writer; + + public PrintWriter delayedWriter; + public PrintWriter delayedWriter2; + } + + public static String getName(SchemaObject obj) { + if (obj.getParent() == null) { + switch (obj.getType()) { + case COMPLEX_TYPE: + return getComplexTypePrefix()+obj.getName(); + case ELEMENT: + return obj.getName(); + case ATTRIBUTE_GROUP: + return getAttributeGroupPrefix()+obj.getName(); + case SIMPLE_TYPE: + return obj.getName(); + } + } else { + SchemaObject o = obj; + SchemaObject prev = null; + String name = ""; + while (o != null){ + if (o.getName() != null) + name = o.getName()+"_"+name; + prev = o; + o = o.getParent(); + if (prev.getObj() instanceof AttributeGroupRef) + o = null; + } + name = name.substring(0, name.length()-1); + switch (prev.getType()) { + case COMPLEX_TYPE: + return getComplexTypePrefix()+name; + case ELEMENT: + return name; + case ATTRIBUTE_GROUP: + return getAttributeGroupPrefix()+name; + case SIMPLE_TYPE: + return name; + } + } + throw new RuntimeException(); + + } + + public static String getName(SchemaObject obj, String rel) { + if (obj.getParent() == null) { + switch (obj.getType()) { + case COMPLEX_TYPE: + return getComplexTypePrefix()+rel+obj.getName(); + case ELEMENT: + return rel+obj.getName(); + case ATTRIBUTE_GROUP: + return getAttributeGroupPrefix()+rel+obj.getName(); + case SIMPLE_TYPE: + return rel+obj.getName(); + } + } else { + SchemaObject o = obj; + SchemaObject prev = null; + String name = ""; + while (o != null){ + if (o.getName() != null) + name = o.getName()+"_"+name; + prev = o; + o = o.getParent(); + } + name = name.substring(0, name.length()-1); + switch (prev.getType()) { + case COMPLEX_TYPE: + return getComplexTypePrefix()+rel+name; + case ELEMENT: + return rel+name; + case ATTRIBUTE_GROUP: + return getAttributeGroupPrefix()+rel+name; + case SIMPLE_TYPE: + return rel+name; + } + } + throw new RuntimeException(); + + } +} diff --git a/org.simantics.xml.sax/src/org/simantics/xml/sax/MultiplicityRestriction.java b/org.simantics.xml.sax/src/org/simantics/xml/sax/MultiplicityRestriction.java new file mode 100644 index 0000000..7762a79 --- /dev/null +++ b/org.simantics.xml.sax/src/org/simantics/xml/sax/MultiplicityRestriction.java @@ -0,0 +1,94 @@ +package org.simantics.xml.sax; + +import org.w3._2001.xmlschema.Any; +import org.w3._2001.xmlschema.Element; +import org.w3._2001.xmlschema.Group; + +class MultiplicityRestriction { + long min; + long max; + + public MultiplicityRestriction(Element element) { + long min = 1; + if (element.getMinOccurs() != null) + min = element.getMinOccurs().longValue(); + String element_maxS = element.getMaxOccurs(); + max = 1; + + if ("unbounded".equals(element_maxS)) { + max = -1; + } else if (element_maxS != null) { + max = Long.parseLong(element_maxS); + max = Math.max(min, max); + } + } + + public MultiplicityRestriction(Group element) { + long min = 1; + if (element.getMinOccurs() != null) + min = element.getMinOccurs().longValue(); + String element_maxS = element.getMaxOccurs(); + max = 1; + + if ("unbounded".equals(element_maxS)) { + max = -1; + } else if (element_maxS != null) { + max = Long.parseLong(element_maxS); + max = Math.max(min, max); + } + } + + public MultiplicityRestriction(Any element) { + long min = 1; + if (element.getMinOccurs() != null) + min = element.getMinOccurs().longValue(); + String element_maxS = element.getMaxOccurs(); + max = 1; + + if ("unbounded".equals(element_maxS)) { + max = -1; + } else if (element_maxS != null) { + max = Long.parseLong(element_maxS); + max = Math.max(min, max); + } + } + + public long getMin() { + return min; + } + + public long getMax() { + return max; + } + + public boolean many() { + return max != 1; + } + + public boolean single() { + return max == 1; + } + + public boolean singleOptional() { + return max == 1 && min == 0; + } + + public boolean singleRequired() { + return max == 1 && min == 1; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) + return false; + if (!getClass().equals(obj.getClass())) + return false; + MultiplicityRestriction other = (MultiplicityRestriction)obj; + return (min == other.min && max == other.max); + } + + @Override + public int hashCode() { + return Long.hashCode(min) + Long.hashCode(max); + } +} \ No newline at end of file diff --git a/org.simantics.xml.sax/src/org/simantics/xml/sax/OntologyGenerator.java b/org.simantics.xml.sax/src/org/simantics/xml/sax/OntologyGenerator.java new file mode 100644 index 0000000..530798e --- /dev/null +++ b/org.simantics.xml.sax/src/org/simantics/xml/sax/OntologyGenerator.java @@ -0,0 +1,594 @@ +package org.simantics.xml.sax; + +import java.io.FileNotFoundException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; + +import javax.xml.namespace.QName; + +import org.simantics.utils.datastructures.BijectionMap; +import org.simantics.xml.sax.configuration.AttributeComposition; +import org.simantics.xml.sax.configuration.Configuration; +import org.simantics.xml.sax.configuration.IDReference; +import org.w3._2001.xmlschema.Annotated; +import org.w3._2001.xmlschema.Attribute; +import org.w3._2001.xmlschema.AttributeGroup; +import org.w3._2001.xmlschema.Element; +import org.w3._2001.xmlschema.LocalComplexType; +import org.w3._2001.xmlschema.LocalSimpleType; +import org.w3._2001.xmlschema.NamedAttributeGroup; +import org.w3._2001.xmlschema.OpenAttrs; +import org.w3._2001.xmlschema.Restriction; +import org.w3._2001.xmlschema.Schema; +import org.w3._2001.xmlschema.SimpleType; +import org.w3._2001.xmlschema.TopLevelAttribute; + +public class OntologyGenerator extends SchemaConversionBase { + + public OntologyGenerator(Configuration configuration) { + super(configuration); + } + + String ontRoot = "ONT."; + String commentTag = "//"; + + Schema schema; + + String className; + + SchemaConverter converter; + + PrintWriter writer = null; + + public String getClassName() { + return className; + } + + public void createOntology(Schema schema, SchemaConverter converter) throws FileNotFoundException { + this.schema = schema; + this.converter = converter; + +// for (OpenAttrs attrs : schema.getIncludeOrImportOrRedefine()) { +// if (attrs instanceof Annotation) { +// Annotation ann = (Annotation)attrs; +// for (Object o : ann.getAppinfoOrDocumentation()) { +// if (o instanceof Documentation) { +// Documentation doc = (Documentation)o; +// } else if (o instanceof Appinfo) { +// Appinfo info = (Appinfo)o; +// } +// } +// } +// } + + + StringWriter stringWriter = null; + if (converter.getOntologyFile() == null) { + stringWriter = new StringWriter(); + writer = new PrintWriter(stringWriter); + } else { + writer = new PrintWriter(converter.getOntologyFile()); + } + + handle(schema); + + writer.flush(); + writer.close(); + if (stringWriter != null) + System.out.println(stringWriter.toString()); + } + + protected void handle(Schema schema) { + String ontologyName = schema.getTargetNamespace(); + if (ontologyName == null) { + ontologyName = converter.getSchemaFile().getName(); + + int index = ontologyName.lastIndexOf("."); + if (index > 0) + ontologyName = ontologyName.substring(0, index); + } + if (!ontologyName.startsWith("http")) + ontologyName = "http://" + ontologyName; + String parts[] = ontologyName.split("/"); + String name = parts[parts.length-1]; + ontRoot = name.substring(0, Math.min(3, name.length())).toUpperCase(); + String version = schema.getVersion(); + if (version == null) + version = "1.0"; + + name = name.replaceAll("\\.", "_"); + className = converter.getPluginName() + "." + name; + + for (String s : converter.getHeader()) { + writer.println(commentTag + " " + s); + } + writer.println(); + writer.println("L0 = "); + writer.println(); + writer.println(ontRoot + " = <" + ontologyName +"-"+ version+"> : L0.Ontology"); + writer.println(" @L0.new"); + writer.println(" L0.HasResourceClass \"" + className +"\""); + writer.println(); + writer.println(); + + ontRoot += "."; + // TODO : these could be created in separate base ontology. + writer.println(commentTag + " Built-in types"); + writer.println(); + writer.println(ontRoot+"XML : L0.Library"); + writer.println(ontRoot+"XML.hasAttribute L0.String"); + writer.println(ontRoot+"XML.ComplexType 0) { + return ontRoot+qtype.getPrefix()+qtype.getLocalPart(); + } + throw new RuntimeException("Reference to unknown type " + qtype.getLocalPart()); + } + + @Override + protected void handle(TopLevelAttribute topLevelAttribute) { + super.handle(topLevelAttribute); + writer.println(); + } + + @Override + protected void handleSimpleType(SchemaObject topLevelSimpleType) { + super.handleSimpleType(topLevelSimpleType); + writer.println(); + } + + + public static String getComplexTypePrefix() { + return "ComplexTypes."; + } + + public static String getAttributeGroupPrefix() { + return "AttributeGroups."; + } + + @Override + protected void handle(SchemaObject parent, SchemaElement indicator, List elements) { + if (indicator.getType() == SchemaElement.ElementType.SEQUENCE || (indicator.getType() == SchemaElement.ElementType.CHOICE && indicator.getRestriction().many())) { + for (SchemaElement e : elements) { + handle(parent, indicator, e); + } + } else if (indicator.getType() == SchemaElement.ElementType.CHOICE) { + String name = getChoiceName(elements); + boolean single = true; + for (SchemaElement e : elements) { + if (e.getRestriction().many()) { + single = false; + break; + } + } + String relationName = ontRoot+getName(parent)+".has"+name; + writer.print(relationName); + + List types = new ArrayList(); + for (SchemaElement e : elements) { + Element localElement = e.getElement(); + QName refType = null; + String type = null; + + if (localElement.getName() != null) { + refType = localElement.getType(); + type = getL0TypeFromPrimitiveType(refType); + } else if (localElement.getRef() != null) { + refType = localElement.getRef(); + type = getL0TypeFromPrimitiveType(refType); + } + if (type == null) { + SchemaObject obj = getWithName(parent, refType.getLocalPart()); + types.add(ontRoot+getName(obj,"has")); + } + } + if (types.size() > 0) { + for (String type : types) { + writer.print(" " + type); + } + } + if (!single) { + writer.println(ontRoot+name+ "List " + ontRoot+name+"List"); + } + } + + } + + + + @Override + protected void handleIndicator(SchemaObject parent, SchemaElement indicator, SchemaElement element, boolean reference, String refName, QName refType) { + String type = getL0TypeFromPrimitiveType(refType); + SchemaObject obj = null; + if (type == null) { + obj = getWithName(parent, refType.getLocalPart()); + + writer.println(ontRoot+getName(parent)+".has"+refName + " " + ontRoot+getName(obj)); + } else { + writer.println(ontRoot+getName(parent)+".has"+refName + " " + getType(refType)); + } + + if (useElementList(parent, indicator,element, reference, refName, refType)) { + + if (type == null) { + writer.println(ontRoot+getName(parent)+"."+refName + "List " + ontRoot+getName(obj)); + if (useElementList(parent, indicator,element, reference, refName, new QName(obj.getName()))) { + writer.println(ontRoot+getName(parent)+"."+refName + "List element = (JAXBElement)facetWrap; +// QName elementName = element.getName(); +// Facet facet = (Facet)element.getValue(); +// } + } + + + + writer.println(relationName+ " " + ontType); + } else if (primitiveType != null) { + writer.println(" attributes) { + Attribute compositionAttribute = new Attribute(); + compositionAttribute.setName(composition.getName()); + QName type = new QName(CONVERSION_NS, composition.getType()); + compositionAttribute.setType(type); + handle(parent, compositionAttribute); + } + + @Override + protected void handleSimpleType(SchemaObject parent, SchemaObject simpleTypeObj) { + SimpleType simpleType = simpleTypeObj.getSimpleType(); + String name = simpleType.getName(); + Restriction restriction = simpleType.getRestriction(); + if (restriction == null || simpleType.getUnion() != null || simpleType.getId() != null) + throw new RuntimeException(); + QName base = restriction.getBase(); + + String relationName = ontRoot+"has"+name; + if (parent != null) + relationName = ontRoot+getName(parent)+".has"+name; + + writer.println(relationName+ " " + ontType); + } + + @Override + protected void handleComplexType(SchemaObject topLevelComplexType) { + String name = getName(topLevelComplexType); + if (name.contains("Pcurve")) + System.out.println(); +// if (parent != null) +// name = parent +"_"+name; + + String relationName = ontRoot+getName(topLevelComplexType,"has");//ontRoot+"has"+name; + + writer.println(relationName+ " " + ontRoot+getComplexTypePrefix()+name); + writer.println(" --> " + ontRoot+name); + writer.println(); + String baseType = ontRoot+"XML.ComplexType"; + + QName base = getComplexTypeBase(topLevelComplexType.getComplexType()); + if (base != null) { + baseType = getType(base); + } + base = getSimpleTypeBase(topLevelComplexType.getSimpleType()); + if (base != null) { + baseType = getType(base); + } + //writer.println(ontRoot+getComplexTypePrefix()+name+ " types = new LinkedHashSet(); + if (element.getType() != null) { + types.add(getType(element.getType())); + } + QName base = getElementBase(element); + if (base != null) { + if (base.getNamespaceURI().equals(SCHEMA_NS)) { + String l0Type = getL0Type(base); + if (l0Type == null) + throw new RuntimeException("Cannot get L0 type for " + base.getLocalPart()); + types.add(l0Type); + } else if (isElementRef(base.getLocalPart())) + types.add(ontRoot+base.getLocalPart()); + else + types.add(ontRoot+getComplexTypePrefix()+base.getLocalPart()); + } + QName substitution = element.getSubstitutionGroup(); + if (substitution != null) { + if (isElementRef(substitution.getLocalPart())) + types.add(ontRoot+substitution.getLocalPart()); + else + types.add( ontRoot+getComplexTypePrefix()+substitution.getLocalPart()); + } + for (String t : types) { + type += " references = getIDReferences(element); + + for (IDReference ref : references) { + writer.println(ontRoot+name+"."+ref.getReference().getName()+ " > typeMap; + + public SchemaConversionBase(Configuration configuration) { + this.configuration = configuration; + typeMap = new HashMap>(); + + Map schemaTypes = new HashMap(); + typeMap.put(SCHEMA_NS, schemaTypes); + Map l0Types = new HashMap(); + typeMap.put(CONVERSION_NS, l0Types); + + schemaTypes.put("string", new TypeEntry("L0.String", "STRING", "String", "")); + schemaTypes.put("NMTOKEN", new TypeEntry("L0.String", "STRING", "String", "")); + schemaTypes.put("token", new TypeEntry("L0.String", "STRING", "String", "")); + schemaTypes.put("ID", new TypeEntry("L0.String", "STRING", "String", "",true)); + schemaTypes.put("IDREF", new TypeEntry("L0.String", "STRING", "String", "")); + schemaTypes.put("date", new TypeEntry("L0.String", "STRING", "String", "")); + schemaTypes.put("time", new TypeEntry("L0.String", "STRING", "String", "")); + schemaTypes.put("anyURI", new TypeEntry("L0.URI", "STRING", "String", "")); + schemaTypes.put("double", new TypeEntry("L0.Double", "DOUBLE", "double", "Double.NaN")); + schemaTypes.put("float", new TypeEntry("L0.Float", "FLOAT", "float", "Float.NaN")); + schemaTypes.put("decimal", new TypeEntry("L0.Double", "DOUBLE", "double", "Double.NaN")); + schemaTypes.put("boolean", new TypeEntry("L0.Boolean", "BOOLEAN", "boolean", "false")); + schemaTypes.put("integer", new TypeEntry("L0.Integer", "INTEGER", "int", "0")); + schemaTypes.put("positiveInteger", new TypeEntry("L0.Integer", "INTEGER", "int", "0")); + schemaTypes.put("nonPositiveInteger", new TypeEntry("L0.Integer", "INTEGER", "int", "0")); + schemaTypes.put("nonNegativeInteger", new TypeEntry("L0.Integer", "INTEGER", "int", "0")); + schemaTypes.put("negativeInteger", new TypeEntry("L0.Integer", "INTEGER", "int", "0")); + schemaTypes.put("unsignedInt", new TypeEntry("L0.Integer", "INTEGER", "int", "0")); + schemaTypes.put("int", new TypeEntry("L0.Integer", "INTEGER", "int", "0")); + schemaTypes.put("short", new TypeEntry("L0.Integer", "INTEGER", "int", "0")); + schemaTypes.put("unsignedShort",new TypeEntry("L0.Integer", "INTEGER", "int", "0")); + schemaTypes.put("byte", new TypeEntry("L0.Byte", "BYTE", "byte", "0")); + schemaTypes.put("unsignedByte", new TypeEntry("L0.Byte", "BYTE", "byte", "0")); + schemaTypes.put("long", new TypeEntry("L0.Long", "LONG", "long", "0")); + schemaTypes.put("unsignedLong", new TypeEntry("L0.Long", "LONG", "long", "0")); + + + + l0Types.put("doubleArray", new TypeEntry("L0.DoubleArray", "DOUBLE_ARRAY", "double[]", null)); + l0Types.put("stringArray", new TypeEntry("L0.StringArray", "STRING_ARRAY", "string[]", null)); + } + + + protected TypeEntry getTypeEntry(QName type) { + Map types = typeMap.get(type.getNamespaceURI()); + if (types == null) + return null; + TypeEntry entry = types.get(type.getLocalPart()); + return entry; + + } + + protected String getL0TypeFromPrimitiveType(QName primitiveType) { + TypeEntry entry = getTypeEntry(primitiveType); + if (entry == null) + return null; + return entry.l0Type; + } + + protected String getL0Type(QName primitiveType) { + String type = getL0TypeFromPrimitiveType(primitiveType); + if (type != null) + return type; + SchemaObject simpleTypeObj = simpleTypeName.get(primitiveType.getLocalPart()); + if (simpleTypeObj == null) + return null; + SimpleType simpleType = simpleTypeObj.getSimpleType(); + while (simpleType != null) { + QName base = simpleType.getRestriction().getBase(); + if (base != null) + return getL0Type(base); + simpleType = simpleType.getRestriction().getSimpleType(); + } + return null; + } + + protected String getBindingFromPrimitiveType(QName primitiveType) { + TypeEntry entry = getTypeEntry(primitiveType); + if (entry == null) + return null; + return entry.binding; + } + + protected String getJavaTypeFromPrimitiveType(QName primitiveType) { + TypeEntry entry = getTypeEntry(primitiveType); + if (entry == null) + return null; + return entry.javaType; + } + + + protected void handle(Schema schema) { + this.schema = schema; + preload(); + + for (OpenAttrs attrs : schema.getSimpleTypeOrComplexTypeOrGroup()) { + if (attrs instanceof TopLevelAttribute) { + handle((TopLevelAttribute)attrs); + + } else if (attrs instanceof TopLevelComplexType) { + handleComplexType(complexTypes.get(attrs)); + } else if (attrs instanceof TopLevelElement) { + handleElement(elements.get(attrs)); + } else if (attrs instanceof TopLevelSimpleType) { + handleSimpleType(simpleTypes.get(attrs)); + } else if (attrs instanceof NamedAttributeGroup) { + handle((NamedAttributeGroup)attrs); + } else { + System.out.println(attrs.getClass().getName()); + } + } + } + + protected Map elementName = new HashMap(); + protected Map complexTypeName = new HashMap(); + protected Map simpleTypeName = new HashMap(); + protected Map elements = new HashMap(); + protected Map complexTypes = new HashMap(); + protected Map simpleTypes = new HashMap(); + + + protected SchemaObject getWithName(SchemaObject referrer, String name) { + SchemaObject obj = elementName.get(name); + if (obj == null) + obj = complexTypeName.get(name); + if (obj == null) + obj = simpleTypeName.get(name); + if (obj == null) { + throw new RuntimeException("Cannot locate referred type " + name + " when handling " + referrer.getName()); + } + return obj; + } + + protected SchemaObject getWithObj(SchemaObject referrer, OpenAttrs attrs) { + SchemaObject obj = null; + if (attrs instanceof Element) + obj = elements.get(attrs); + else if (attrs instanceof ComplexType) + obj = complexTypes.get(attrs); + else if (attrs instanceof SimpleType) + obj = simpleTypes.get(attrs); + if (obj == null){ + throw new RuntimeException("Cannot locate referred object " + attrs + " when handling " + referrer.getName()); + } + return obj; + } + + private void preload() { + Deque stack = new ArrayDeque(); + //stack.addAll(schema.getSimpleTypeOrComplexTypeOrGroup()); + for (OpenAttrs attrs : schema.getSimpleTypeOrComplexTypeOrGroup()) { + if (attrs instanceof Element) { + Element element = (Element)attrs; + SchemaObject obj = new SchemaObject(element); + stack.push(obj); + } else if (attrs instanceof ComplexType) { + ComplexType complexType = (ComplexType)attrs; + SchemaObject obj = new SchemaObject(complexType); + stack.push(obj); + } else if (attrs instanceof SimpleType) { + SimpleType simpleType = (SimpleType)attrs; + SchemaObject obj = new SchemaObject(simpleType); + stack.push(obj); + } + } + + while (!stack.isEmpty()) { + SchemaObject object = stack.pop(); + if (object.getType() == ObjectType.COMPLEX_TYPE) { + ComplexType ct = object.getComplexType(); + if (ct.getName() != null && ct.getName().length() > 0 && ct instanceof TopLevelComplexType) + complexTypeName.put(ct.getName(), object); + complexTypes.put(ct, object); + if (ct.getChoice() != null) { + preload(object,ct.getChoice(), stack); + } + if (ct.getSequence() != null) { + preload(object,ct.getSequence(), stack); + } + if (ct.getAll() != null) { + preload(object,ct.getAll(), stack); + } + if (ct.getGroup() != null) + throw new RuntimeException("Groups not supported"); + if (ct.getComplexContent() != null) { + ComplexContent cc = ct.getComplexContent(); + ExtensionType extensionType = cc.getExtension(); + if (extensionType != null) { + if (extensionType.getChoice() != null) { + preload(object,extensionType.getChoice(), stack); + } + if (extensionType.getSequence()!= null) { + preload(object,extensionType.getSequence(), stack); + } + if (extensionType.getAll()!= null) { + preload(object,extensionType.getAll(), stack); + } + if (extensionType.getGroup() != null) + throw new RuntimeException("Groups not supported"); + } + } + } else if (object.getType() == ObjectType.ELEMENT) { + Element e = object.getElement(); + if (e instanceof TopLevelElement) + elementName.put(e.getName(), object); + elements.put(e, object); + if (e.getComplexType() != null) + stack.push(new SchemaObject(object,e.getComplexType())); + if (e.getSimpleType() != null) + stack.push(new SchemaObject(object,e.getSimpleType())); + } else if (object.getType() == ObjectType.SIMPLE_TYPE) { + SimpleType e = object.getSimpleType(); + if (e instanceof TopLevelSimpleType) + simpleTypeName.put(e.getName(), object); + simpleTypes.put(e, object); + } + } + } + + private void preload(SchemaObject parent,ExplicitGroup eg, Deque stack) { + for (Object o : eg.getParticle()) { + if (o instanceof JAXBElement) { + JAXBElement element = (JAXBElement)o; + Object elemValue = element.getValue(); + if (elemValue instanceof Element) { + stack.add(new SchemaObject(parent,(Element)elemValue)); + } else if (elemValue instanceof All) { + preload(parent,(All)elemValue, stack); + } else if (elemValue instanceof ExplicitGroup) { + preload(parent,(ExplicitGroup)elemValue, stack); + } else { + throw new RuntimeException("Unknown ExplicitGroup element " + elemValue.getClass().getName()); + } + } else if (o instanceof Any){ + + } else { + throw new RuntimeException("Unknown ExplicitGroup reference " + o.getClass().getName()); + } + } + } + + protected void handle(TopLevelAttribute topLevelAttribute) { + handle(null, topLevelAttribute); + } + + protected void handleSimpleType(SchemaObject topLevelSimpleType) { + handleSimpleType(null,topLevelSimpleType); + } + + protected void handle(NamedAttributeGroup namedAttributeGroup){ + handle(null, namedAttributeGroup); + } + + protected QName getComplexTypeBase(ComplexType complexType) { + if (complexType == null) + return null; + ComplexContent complexContent = complexType.getComplexContent(); + if (complexContent != null) { + ExtensionType extensionType = complexContent.getExtension(); + if (extensionType != null) { + QName type = extensionType.getBase(); + return type; + } + } + return null; + } + + protected QName getSimpleTypeBase(SimpleType simpleType) { + if (simpleType == null) + return null; + return simpleType.getRestriction().getBase(); + } + + protected QName getElementBase(Element element) { + ComplexType complexType = element.getComplexType(); + SimpleType simpleType = element.getSimpleType(); + if (complexType != null) + return getComplexTypeBase(complexType); + if (simpleType != null) { + return getSimpleTypeBase(simpleType); + } + return null; + } + + + + + + + + + private void handleAttributes(SchemaObject complexType, List attributeOrAttributeGroup) { + //name = getComplexTypePrefix()+complexType.getName() + + Set handled = handleAttributeCompositions(complexType,attributeOrAttributeGroup); + for (Annotated annotated : attributeOrAttributeGroup) { + if (handled.contains(annotated)) + continue; + if (annotated instanceof Attribute) { + handle(complexType,(Attribute)annotated); + } else if (annotated instanceof AttributeGroup){ + handle(complexType,(AttributeGroup)annotated); + //comment("AttributeGroup " + ((AttributeGroup)annotated).getRef().getLocalPart()); + } else { + throw new RuntimeException(); + } + } + } + + protected abstract void handleAttributes(SchemaObject simpleTypeObj); + + protected void handleExtensionAttributes(SchemaObject complexType) { + ComplexContent complexContent = complexType.getComplexType().getComplexContent(); + if (complexContent != null) { + ExtensionType extensionType = complexContent.getExtension(); + if (extensionType != null) { + handleAttributes(complexType, extensionType.getAttributeOrAttributeGroup()); + } + } + } + + + + protected void handleComplexTypeAttributes(SchemaObject complexType) { + handleAttributes(complexType,complexType.getComplexType().getAttributeOrAttributeGroup()); + } + + protected void handleElementComplexTypeAttributes(SchemaObject complexType) { + if (complexType != null) { + handleComplexTypeAttributes(complexType); + handleExtensionAttributes(complexType); + } + } + + protected void handleElementSimpleTypeAttributes(SchemaObject simpleType) { + if (simpleType != null) { + handleAttributes(simpleType); + } + } + + protected Set handleAttributeCompositions(SchemaObject obj, List attributeOrAttributeGroup) { + + Set handled = new HashSet(); + for (JAXBElement e : configuration.getConversionRule()) { + if (e.getValue() instanceof AttributeComposition) { + AttributeComposition composition = (AttributeComposition)e.getValue(); + if (composition.getAttribute().size() < 2) + throw new RuntimeException("Attribute Composition is not valid"); + BijectionMap map = new BijectionMap(); + for (org.simantics.xml.sax.configuration.Attribute a : composition.getAttribute()) { + for (Annotated annotated : attributeOrAttributeGroup) { + if (annotated instanceof Attribute) { + Attribute attribute = (Attribute)annotated; + QName type = getBaseType(attribute); + if (a.getName().equals(attribute.getName()) && type != null && a.getType().equals(type.getLocalPart())) { + map.map(a, attribute); + } + } + } + } + if (composition.getAttribute().size() == map.size()) { + handled.addAll(map.getRightSet()); + handleAttributeComposition(obj, composition, map); + } + } + } + return handled; + } + + protected QName getBaseType(Attribute attribute) { + if (attribute.getType() != null) + return attribute.getType(); + if (attribute.getRef() != null) + return attribute.getRef(); + SimpleType simpleType = attribute.getSimpleType(); + if (simpleType != null) { + Restriction restriction = simpleType.getRestriction(); + if (restriction != null) + if (restriction.getBase() != null) + return restriction.getBase(); + } + return null; + } + + protected Attribute getRefAttribute(QName ref) { + for (OpenAttrs attrs : schema.getSimpleTypeOrComplexTypeOrGroup()) { + if (attrs instanceof TopLevelAttribute) { + TopLevelAttribute attribute = (TopLevelAttribute)attrs; + if (attribute.getName().equals(ref.getLocalPart())) + return attribute; + } + } + return null; + } + + protected abstract void handleAttributeComposition(SchemaObject obj, AttributeComposition composition, BijectionMap attributes); + + + + + protected void handleComplexType(SchemaObject complexType) { + handleComplexTypeAttributes(complexType); + handleComplexTypeExtension(complexType); + handleExtensionAttributes(complexType); + } + + protected abstract void handleIndicator(SchemaObject parent, SchemaElement indicator, SchemaElement element, boolean reference, String refName, QName refType); + protected abstract void handleIndicator(SchemaObject parent, SchemaElement indicator, SchemaElement element, boolean reference, String refName, OpenAttrs ref); + protected abstract void handleIndicator(SchemaObject parent, SchemaElement indicator, SchemaElement any); + protected abstract void handle(SchemaObject parent, SchemaElement indicator, List elements); + + protected void handle(SchemaObject parent, ExplicitGroup eg, SchemaElement.ElementType indicator) { + handle(parent, new SchemaElement(eg, indicator)); + } + + protected void handle(SchemaObject parent, SchemaElement indicator) { + + + List elements = new ArrayList(); + List choices = new ArrayList(); + List sequences = new ArrayList(); + List alls = new ArrayList(); + List anys = new ArrayList(); + + for (Object o : indicator.getGroup().getParticle()) { + if (o instanceof JAXBElement) { + JAXBElement element = (JAXBElement)o; + Object elemValue = element.getValue(); + if (elemValue instanceof LocalElement) { + LocalElement localElement = (LocalElement)elemValue; + + elements.add(new SchemaElement(indicator,localElement, ElementType.ELEMENT)); + } else if (elemValue instanceof All) { + alls.add(new SchemaElement(indicator,(All)elemValue, ElementType.ALL)); + } else if (elemValue instanceof ExplicitGroup) { + QName qname = element.getName(); + if ("choice".equals(qname.getLocalPart())) { + choices.add(new SchemaElement(indicator,(ExplicitGroup)elemValue, ElementType.CHOICE)); + } else if ("sequence".equals(qname.getLocalPart())) { + sequences.add(new SchemaElement(indicator,(ExplicitGroup)elemValue, ElementType.SEQUENCE)); + } + } else { + throw new RuntimeException("Unknown ExplicitGroup element " + elemValue.getClass().getName()); + } + } else if (o instanceof Any){ + anys.add(new SchemaElement(indicator,(Any)o, ElementType.ANY)); + } else { + throw new RuntimeException("Unknown ExplicitGroup reference " + o.getClass().getName()); + } + } + + if (elements.size() == 0 && choices.size() == 0 && sequences.size() == 0 && alls.size() == 0 && anys.size() == 0) { + return; + } + + if (indicator.getType() == SchemaElement.ElementType.SEQUENCE) { + if (indicator.getRestriction().single()) { + if (elements.size() > 0) { + for (SchemaElement e : sequences) { + handle(parent, e); + } + for (SchemaElement c : choices) { + handle(parent, c); + } + + for (SchemaElement c : alls) { + handle(parent, c); + } + handle(parent, indicator, elements); + for (SchemaElement a : anys) { + handleIndicator(parent, indicator, a); + } + } else { + if (sequences.size() > 0) { + throw new RuntimeException("Cannot handle Sequence with inner Sequences"); + } + for (SchemaElement c : choices) { + handle(parent, c); + } + for (SchemaElement a : anys) { + handleIndicator(parent, indicator, a); + } + } + } else { + if (sequences.size() > 0 || choices.size() > 0 || alls.size() > 0) { + throw new RuntimeException("Cannot handle Sequence with inner ExplicitGroups"); + } + handle(parent, indicator, elements); + for (SchemaElement a : anys) { + handleIndicator(parent, indicator, a); + } + } + + } else if (indicator.getType() == SchemaElement.ElementType.CHOICE){ + if (indicator.getRestriction().single()) { + if (sequences.size()> 0 || choices.size() > 0 || alls.size() > 0 || anys.size() > 0) { + throw new RuntimeException("Cannot handle Choice that contains something else than Elements"); + } + handle(parent, indicator, elements); + + } else { + if (sequences.size() > 0 || choices.size() > 0) { + throw new RuntimeException("Cannot handle Choice with inner ExplicitGroups"); + } + handle(parent, indicator, elements); + for (SchemaElement a : anys) { + handleIndicator(parent, indicator, a); + } + } + } else if (indicator.getType() == ElementType.ALL) { + if (sequences.size()> 0 || choices.size() > 0 || alls.size() > 0 || anys.size() > 0) { + throw new RuntimeException("Cannot handle All that contains something else than Elements"); + } + if (!indicator.getRestriction().single()) { + throw new RuntimeException("All indicator must have maxOccurs=1"); + } + handle(parent, indicator, elements); + } + } + + + protected void handle(SchemaObject parent, SchemaElement indicator, SchemaElement element) { + Element localElement = element.getElement(); + if (localElement.getName() != null) { + String refName = localElement.getName(); + QName refType = localElement.getType(); + if (refType != null) + handleIndicator(parent, indicator, element, false, refName, refType); + else { + handleElement(elements.get(localElement)); + handleIndicator(parent, indicator, element, false, refName, localElement); + //FIXME: + } + } else if (localElement.getRef() != null) { + QName refType = localElement.getRef(); + handleIndicator(parent, indicator,element, true, refType.getLocalPart(), refType); + } + } + + protected String getElementName(Element localElement) { + if (localElement.getName() != null) { + String refName = localElement.getName(); + QName refType = localElement.getType(); + if (refType != null) + return refName; + } else if (localElement.getRef() != null) { + QName refType = localElement.getRef(); + if (refType != null) + return refType.getLocalPart(); + } + return null; + } + + protected String getChoiceName(List elements) { + if (elements.size() == 1) { + return getElementName(elements.get(0).getElement()); + } + List names = new ArrayList(); + for (SchemaElement e : elements) { + String name = getElementName(e.getElement()); + if (name != null) + names.add(name); + } + String name = ""; + for (int i = 0; i < names.size(); i++) { + if (i == 0) + name = names.get(i); + else + name += "Or"+names.get(i); + } + return name; + } + + + protected abstract void handle(SchemaObject parent, Attribute attribute) ; + protected abstract void handle(SchemaObject parent, AttributeGroup attribute) ; + + protected abstract void handleSimpleType(SchemaObject parent, SchemaObject simpleType); + + + + protected void handleComplexTypeExtension(SchemaObject complexTypeObj) { + ComplexType complexType = complexTypeObj.getComplexType(); + if (complexType != null) { + if (complexType.getChoice() != null) + handle(complexTypeObj, complexType.getChoice(), SchemaElement.ElementType.CHOICE); + if (complexType.getSequence() != null) + handle(complexTypeObj, complexType.getSequence(), SchemaElement.ElementType.SEQUENCE); + if (complexType.getAll() != null) + handle(complexTypeObj, complexType.getAll(), SchemaElement.ElementType.ALL); + if (complexType.getGroup() != null) + throw new RuntimeException("Groups not supported"); + ComplexContent complexContent = complexType.getComplexContent(); + if (complexContent != null) { + ExtensionType extensionType = complexContent.getExtension(); + if (extensionType != null) { + if (extensionType.getChoice() != null) { + handle(complexTypeObj, extensionType.getChoice(), SchemaElement.ElementType.CHOICE); + } + if (extensionType.getSequence()!= null) { + handle(complexTypeObj, extensionType.getSequence(), SchemaElement.ElementType.SEQUENCE); + } + if (extensionType.getAll()!= null) { + handle(complexTypeObj, extensionType.getAll(), SchemaElement.ElementType.ALL); + } + if (extensionType.getGroup() != null) { + throw new RuntimeException("Groups not supported"); + } + } + } + } + } + + protected void handleElement(SchemaObject topLevelElement) { + LocalComplexType complexType = topLevelElement.getElement().getComplexType(); + + if (complexType != null) { + SchemaObject complextTypeObj = complexTypes.get(complexType); + handleElementComplexTypeAttributes(complextTypeObj); + handleComplexTypeExtension(complextTypeObj); + } + + + } + + + protected boolean isElementRef(String ref) { +// for (OpenAttrs attrs : schema.getSimpleTypeOrComplexTypeOrGroup()) { +// if (attrs instanceof TopLevelElement) { +// TopLevelElement element = (TopLevelElement)attrs; +// if (ref.equals(element.getName())) +// return true; +// } +// } +// return false; + return elementName.containsKey(ref); + } + + protected boolean isComplexTypeRef(String ref) { +// for (OpenAttrs attrs : schema.getSimpleTypeOrComplexTypeOrGroup()) { +// if (attrs instanceof TopLevelComplexType) { +// TopLevelComplexType element = (TopLevelComplexType)attrs; +// if (ref.equals(element.getName())) +// return true; +// } +// } +// return false; + return complexTypeName.containsKey(ref); + + } + + protected NamedAttributeGroup getAttributeGroup(String name) { + for (OpenAttrs attrs : schema.getSimpleTypeOrComplexTypeOrGroup()) { + if (attrs instanceof NamedAttributeGroup) { + NamedAttributeGroup group = (NamedAttributeGroup)attrs; + if (group.getName().equals(name)) + return group; + } + } + return null; + } + + protected IDProvider getIDProvider(Element element) { + List idProviders = new ArrayList(2); + for (JAXBElement e : configuration.getConversionRule()) { + if (e.getValue() instanceof IDProvider) { + IDProvider ref = (IDProvider)e.getValue(); + org.simantics.xml.sax.configuration.Element element2 = ref.getElement(); + if (element2 != null) { + if (element.getName().equals(element2.getName())) + idProviders.add(ref); + } + + } + } + if (idProviders.size() == 0) + return null; + if (idProviders.size() > 1) + throw new RuntimeException("Element " + element.getName() + " contains " + idProviders.size() + " id provider rules, only one is allowed."); + return idProviders.get(0); + } + + protected IDProvider getIDProvider(ComplexType complexType) { + List idProviders = new ArrayList(2); + for (JAXBElement e : configuration.getConversionRule()) { + if (e.getValue() instanceof IDProvider) { + IDProvider ref = (IDProvider)e.getValue(); + org.simantics.xml.sax.configuration.ComplexType complexType2 = ref.getComplexType(); + if (complexType2 != null) { + if (complexType.getName().equals(complexType2.getName())) + idProviders.add(ref); + } + + } + } + if (idProviders.size() == 0) + return null; + if (idProviders.size() > 1) + throw new RuntimeException("Element " + complexType.getName() + " contains " + idProviders.size() + " id provider rules, only one is allowed."); + return idProviders.get(0); + } + + protected List getIDReferences(Element element) { + List idReferences = new ArrayList(2); + for (JAXBElement e : configuration.getConversionRule()) { + if (e.getValue() instanceof IDReference) { + IDReference ref = (IDReference)e.getValue(); + org.simantics.xml.sax.configuration.Element element2 = ref.getElement(); + if (element2 != null) { + if (element.getName().equals(element2.getName())) + idReferences.add(ref); + } + } + } + return idReferences; + } + + protected List getIDReferences(ComplexType complexType) { + List idReferences = new ArrayList(2); + for (JAXBElement e : configuration.getConversionRule()) { + if (e.getValue() instanceof IDReference) { + IDReference ref = (IDReference)e.getValue(); + org.simantics.xml.sax.configuration.ComplexType complexType2 = ref.getComplexType(); + if (complexType2 != null) { + if (complexType.getName().equals(complexType2.getName())) + idReferences.add(ref); + } + } + } + return idReferences; + } + + public UnrecognizedChildElement getUnknown(ComplexType complexType) { + for (JAXBElement e : configuration.getConversionRule()) { + if (e.getValue() instanceof UnrecognizedChildElement) { + UnrecognizedChildElement ref = (UnrecognizedChildElement)e.getValue(); + org.simantics.xml.sax.configuration.ComplexType complexType2 = ref.getComplexType(); + if (complexType2 != null) { + if (complexType.getName().equals(complexType2.getName())) + return ref; + } + } + } + return null; + } + + public UnrecognizedChildElement getUnknown(Element element) { + for (JAXBElement e : configuration.getConversionRule()) { + if (e.getValue() instanceof UnrecognizedChildElement) { + UnrecognizedChildElement ref = (UnrecognizedChildElement)e.getValue(); + org.simantics.xml.sax.configuration.Element element2 = ref.getElement(); + if (element2 != null) { + if (element.getName().equals(element2.getName())) + return ref; + } + } + } + return null; + } + + + public boolean useOriginalList(SchemaObject parent, SchemaElement indicator, SchemaElement element, boolean reference, String ref, QName refType) { + if (parent.getName() == null) + parent = parent.getParent(); + if (parent.getName().contains("PipingNetworkSegment")) + System.out.println(); + for (JAXBElement e : configuration.getConversionRule()) { + if (e.getValue() instanceof OrderedChild) { + OrderedChild oc = (OrderedChild)e.getValue(); + org.simantics.xml.sax.configuration.Element element2 = oc.getElement(); + org.simantics.xml.sax.configuration.ComplexType complexType = oc.getComplexType(); + org.simantics.xml.sax.configuration.Element child = oc.getChild(); + if (!oc.getType().equals("original")) + continue; + boolean match = false; + if (element2 != null) { + if (parent.getType() == ObjectType.ELEMENT && parent.getName().equals(element2.getName())) { + match = true; + } + } else if (complexType != null) { + if (parent.getType() == ObjectType.COMPLEX_TYPE && parent.getName() != null && parent.getName().equals(complexType.getName())) { + match = true; + } + + } + if (match) { + if (child != null) { + if (matchChild(child, ref, refType)) { + if (oc.getValue().equals("disable")) + return false; + else return true; + } + } else { + if (oc.getValue().equals("disable")) + return false; + return true; + } + + } + } + } + return indicator.order(); + } + + public boolean useElementList(SchemaObject parent, SchemaElement indicator, SchemaElement element, boolean reference, String refName, QName refType) { + if (parent.getName() == null) + parent = parent.getParent(); + if (parent.getName() == "PipingNetworkSegment") + System.out.println(); + for (JAXBElement e : configuration.getConversionRule()) { + if (e.getValue() instanceof OrderedChild) { + OrderedChild oc = (OrderedChild)e.getValue(); + org.simantics.xml.sax.configuration.Element element2 = oc.getElement(); + org.simantics.xml.sax.configuration.ComplexType complexType = oc.getComplexType(); + org.simantics.xml.sax.configuration.Element child = oc.getChild(); + if (!oc.getType().equals("child")) + continue; + boolean match = false; + if (element2 != null) { + if (parent.getType() == ObjectType.ELEMENT && parent.getName().equals(element2.getName())) { + match = true; + } + } else if (complexType != null) { + if (parent.getType() == ObjectType.COMPLEX_TYPE && parent.getName() != null && parent.getName().equals(complexType.getName())) { + match = true; + } + + } + if (match) { + if (child != null) { + if (matchChild(child, refName, refType)) { + if (oc.getValue().equals("disable")) + return false; + else return true; + } + } else { + if (oc.getValue().equals("disable")) + return false; + return true; + } + + } + } + } + return element.many() && element.order(); + } + + private boolean matchChild(org.simantics.xml.sax.configuration.Element child, String refName, QName refType) { + if (refType != null && refType.getLocalPart().equals(child.getName())) + return true; + if (refName != null && refName.equals(child.getName())) + return true; + return false; + } + + public static class TypeEntry { + String l0Type; + String binding; + String javaType; + String defaultValue; + boolean id; + public TypeEntry(String l0Type, String binding, String javaType, String defaultValue) { + super(); + this.l0Type = l0Type; + this.binding = binding; + this.javaType = javaType; + this.defaultValue = defaultValue; + this.id = false; + } + + public TypeEntry(String l0Type, String binding, String javaType, String defaultValue, boolean id) { + super(); + this.l0Type = l0Type; + this.binding = binding; + this.javaType = javaType; + this.defaultValue = defaultValue; + this.id = id; + } + + } + +} diff --git a/org.simantics.xml.sax/src/org/simantics/xml/sax/SchemaConverter.java b/org.simantics.xml.sax/src/org/simantics/xml/sax/SchemaConverter.java new file mode 100644 index 0000000..523788c --- /dev/null +++ b/org.simantics.xml.sax/src/org/simantics/xml/sax/SchemaConverter.java @@ -0,0 +1,121 @@ +package org.simantics.xml.sax; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Date; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; + +import org.simantics.xml.sax.configuration.Configuration; +import org.w3._2001.xmlschema.Schema; + +/** + * This file is developed for XMpLant / Proteus schema conversion is not able to handle all XML Schema definitions. + * + * @author mlmarko + * + */ +public class SchemaConverter { + + File schemaFile; + File conversionFile; + File ontologyFile; + File parserDir; + Schema schema; + Configuration configuration; + + String pluginName; + + private String[] header; + + + public void convertSchema(File schemaFile, File conversionFile, File outputPlugin) throws JAXBException, IOException { + pluginName = outputPlugin.getName(); + String packageParts[] = pluginName.split("\\."); + String outputLoc = outputPlugin.getAbsolutePath(); + outputLoc += "/src"; + for (String s : packageParts) + outputLoc += "/"+s; + String outputGraph = outputPlugin.getAbsolutePath(); + outputGraph += "/graph"; + outputGraph += "/" + schemaFile.getName().substring(0, schemaFile.getName().length()-4) +".pgraph"; + + this.schemaFile = schemaFile; + this.conversionFile = conversionFile; + this.ontologyFile = new File(outputGraph); + this.parserDir = new File(outputLoc); + + if (!ontologyFile.exists()) { + ontologyFile.getParentFile().mkdirs(); + ontologyFile.createNewFile(); + } + if (!parserDir.exists()) + parserDir.mkdirs(); + + convert(); + + } + + private void convert() throws JAXBException, IOException { + JAXBContext jc = JAXBContext.newInstance("org.w3._2001.xmlschema"); + Unmarshaller u = jc.createUnmarshaller(); + //u.setSchema(schema); + InputStream fileStream = new FileInputStream(schemaFile); + schema = (Schema)u.unmarshal(fileStream); + + if (conversionFile != null) { + jc = JAXBContext.newInstance("org.simantics.xml.sax.configuration"); + u = jc.createUnmarshaller(); + fileStream = new FileInputStream(conversionFile); + configuration = (Configuration)((JAXBElement)u.unmarshal(fileStream)).getValue(); + } else { + configuration = new Configuration(); + } + + header = new String[4]; + header[0] = "Generated with org.simantics.xml.sax XML schema converter"; + header[1] = ""; + header[2] = "File " + schemaFile.getAbsolutePath(); + header[3] = "Date " + new Date().toString(); + + + OntologyGenerator ontologyGenerator = new OntologyGenerator(configuration); + ontologyGenerator.createOntology(schema, this); + ImporterGenerator importerGenerator = new ImporterGenerator(configuration); + importerGenerator.createParser(schema, ontologyGenerator.getClassName(), this); + } + + public File getOntologyFile() { + return ontologyFile; + } + public File getParserDir() { + return parserDir; + } + + public Schema getSchema() { + return schema; + } + + public File getSchemaFile() { + return schemaFile; + } + + public String getPluginName() { + return pluginName; + } + + public String[] getHeader() { + return header; + } + + public Configuration getConfiguration() { + return configuration; + } + + +} diff --git a/org.simantics.xml.sax/src/org/simantics/xml/sax/SchemaElement.java b/org.simantics.xml.sax/src/org/simantics/xml/sax/SchemaElement.java new file mode 100644 index 0000000..dc43781 --- /dev/null +++ b/org.simantics.xml.sax/src/org/simantics/xml/sax/SchemaElement.java @@ -0,0 +1,102 @@ +package org.simantics.xml.sax; + +import org.w3._2001.xmlschema.Any; +import org.w3._2001.xmlschema.Element; +import org.w3._2001.xmlschema.Group; + +public class SchemaElement { + + public enum ElementType{CHOICE,SEQUENCE,ALL,ANY,ELEMENT} + + private Group gelement; + private Any aelement; + private Element eelement; + private MultiplicityRestriction restriction; + private SchemaElement.ElementType type; + + private SchemaElement parent; + + public SchemaElement(Group element, ElementType indicator) { + this.gelement = element; + this.type = indicator; + this.restriction = new MultiplicityRestriction(element); + } + + public SchemaElement(Any element, ElementType indicator) { + this.aelement = element; + this.type = indicator; + this.restriction = new MultiplicityRestriction(element); + } + + public SchemaElement(Element element, ElementType indicator) { + this.eelement = element; + this.type = indicator; + this.restriction = new MultiplicityRestriction(element); + } + + public SchemaElement(SchemaElement parent, Group element, ElementType indicator) { + this.parent = parent; + this.gelement = element; + this.type = indicator; + this.restriction = new MultiplicityRestriction(element); + } + + public SchemaElement(SchemaElement parent, Any element, ElementType indicator) { + this.parent = parent; + this.aelement = element; + this.type = indicator; + this.restriction = new MultiplicityRestriction(element); + } + + public SchemaElement(SchemaElement parent, Element element, ElementType indicator) { + this.parent = parent; + this.eelement = element; + this.type = indicator; + this.restriction = new MultiplicityRestriction(element); + } + + public Group getGroup() { + return gelement; + } + + public Any getAny() { + return aelement; + } + + public Element getElement() { + return eelement; + } + + public MultiplicityRestriction getRestriction() { + return restriction; + } + + public ElementType getType() { + return type; + } + + public SchemaElement getParent() { + return parent; + } + + + public boolean order() { + if (type == ElementType.ELEMENT) { + if (restriction.many()) + return true; + return false; + } + if (type == ElementType.SEQUENCE) + return true; + return false; + } + + public boolean many() { + if (restriction.many()) + return true; + if (parent != null) + return parent.many(); + return false; + } + +} diff --git a/org.simantics.xml.sax/src/org/simantics/xml/sax/SchemaObject.java b/org.simantics.xml.sax/src/org/simantics/xml/sax/SchemaObject.java new file mode 100644 index 0000000..3b45c7e --- /dev/null +++ b/org.simantics.xml.sax/src/org/simantics/xml/sax/SchemaObject.java @@ -0,0 +1,109 @@ +package org.simantics.xml.sax; + +import org.w3._2001.xmlschema.AttributeGroup; +import org.w3._2001.xmlschema.AttributeGroupRef; +import org.w3._2001.xmlschema.ComplexType; +import org.w3._2001.xmlschema.Element; +import org.w3._2001.xmlschema.NamedAttributeGroup; +import org.w3._2001.xmlschema.OpenAttrs; +import org.w3._2001.xmlschema.SimpleType; + +public class SchemaObject { + enum ObjectType{ELEMENT,COMPLEX_TYPE,SIMPLE_TYPE,ATTRIBUTE_GROUP}; + + private SchemaObject parent; + private ObjectType type; + private OpenAttrs obj; + + public SchemaObject(Element element) { + this(null,element); + } + + public SchemaObject(ComplexType complexType) { + this(null, complexType); + } + + public SchemaObject(SimpleType simpleType) { + this(null, simpleType); + } + + public SchemaObject(SchemaObject parent, Element element) { + this.parent = parent; + this.obj = element; + this.type = ObjectType.ELEMENT; + } + + public SchemaObject(SchemaObject parent, ComplexType complexType) { + this.parent = parent; + this.obj = complexType; + this.type = ObjectType.COMPLEX_TYPE; + } + + public SchemaObject(SchemaObject parent, AttributeGroup attributeGroup) { + this.parent = parent; + this.obj = attributeGroup; + this.type = ObjectType.ATTRIBUTE_GROUP; + } + + + public SchemaObject(SchemaObject parent, SimpleType simpleType) { + this.parent = parent; + this.obj = simpleType; + this.type = ObjectType.SIMPLE_TYPE; + } + + public Element getElement() { + if (type != ObjectType.ELEMENT) + return null; + return (Element)obj; + } + + public ComplexType getComplexType() { + if (type != ObjectType.COMPLEX_TYPE) + return null; + return (ComplexType)obj; + } + + public SimpleType getSimpleType() { + if (type != ObjectType.SIMPLE_TYPE) + return null; + return (SimpleType)obj; + } + + public AttributeGroup getAttributeGroup() { + if (type != ObjectType.ATTRIBUTE_GROUP) + return null; + return (AttributeGroup)obj; + } + + public SchemaObject getParent() { + return parent; + } + + public OpenAttrs getObj() { + return obj; + } + + + public String getName() { + switch (type) { + case ATTRIBUTE_GROUP: + if (obj instanceof NamedAttributeGroup) + return ((NamedAttributeGroup)obj).getName(); + else + return ((AttributeGroupRef)obj).getRef().getLocalPart(); + case COMPLEX_TYPE: + return ((ComplexType)obj).getName(); + case ELEMENT: + return ((Element)obj).getName(); + case SIMPLE_TYPE: + return ((SimpleType)obj).getName(); + } + throw new RuntimeException("Unknown object type " + type); + } + + public ObjectType getType() { + return type; + } + +} diff --git a/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/Attribute.java b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/Attribute.java new file mode 100644 index 0000000..91b9848 --- /dev/null +++ b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/Attribute.java @@ -0,0 +1,92 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.11.25 at 04:57:27 PM EET +// + + +package org.simantics.xml.sax.configuration; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for Attribute complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="Attribute">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="Type" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="Name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Attribute") +public class Attribute { + + @XmlAttribute(name = "Type") + protected String type; + @XmlAttribute(name = "Name") + protected String name; + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/AttributeComposition.java b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/AttributeComposition.java new file mode 100644 index 0000000..b6beb40 --- /dev/null +++ b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/AttributeComposition.java @@ -0,0 +1,133 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.11.25 at 04:57:27 PM EET +// + + +package org.simantics.xml.sax.configuration; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.simantics.org/xml/sax/configuration/}ConversionRule">
+ *       <sequence maxOccurs="unbounded">
+ *         <element ref="{http://www.simantics.org/xml/sax/configuration/}Attribute"/>
+ *       </sequence>
+ *       <attribute name="Type" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="Name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "attribute" +}) +public class AttributeComposition + extends ConversionRule +{ + + @XmlElement(name = "Attribute", required = true) + protected List attribute; + @XmlAttribute(name = "Type") + protected String type; + @XmlAttribute(name = "Name") + protected String name; + + /** + * Gets the value of the attribute property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the attribute property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getAttribute().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Attribute } + * + * + */ + public List getAttribute() { + if (attribute == null) { + attribute = new ArrayList(); + } + return this.attribute; + } + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/ComplexType.java b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/ComplexType.java new file mode 100644 index 0000000..cd4d328 --- /dev/null +++ b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/ComplexType.java @@ -0,0 +1,65 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.11.25 at 04:57:27 PM EET +// + + +package org.simantics.xml.sax.configuration; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for ComplexType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="ComplexType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="Name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ComplexType") +public class ComplexType { + + @XmlAttribute(name = "Name") + protected String name; + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/Configuration.java b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/Configuration.java new file mode 100644 index 0000000..1ab2be7 --- /dev/null +++ b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/Configuration.java @@ -0,0 +1,82 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.11.25 at 04:57:27 PM EET +// + + +package org.simantics.xml.sax.configuration; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for Configuration complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="Configuration">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence maxOccurs="unbounded" minOccurs="0">
+ *         <element ref="{http://www.simantics.org/xml/sax/configuration/}ConversionRule"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Configuration", propOrder = { + "conversionRule" +}) +public class Configuration { + + @XmlElementRef(name = "ConversionRule", namespace = "http://www.simantics.org/xml/sax/configuration/", type = JAXBElement.class, required = false) + protected List> conversionRule; + + /** + * Gets the value of the conversionRule property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the conversionRule property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getConversionRule().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link OrderedChild }{@code >} + * {@link JAXBElement }{@code <}{@link IDReference }{@code >} + * {@link JAXBElement }{@code <}{@link AttributeComposition }{@code >} + * {@link JAXBElement }{@code <}{@link UnrecognizedChildElement }{@code >} + * {@link JAXBElement }{@code <}{@link ConversionRule }{@code >} + * {@link JAXBElement }{@code <}{@link IDProvider }{@code >} + * + * + */ + public List> getConversionRule() { + if (conversionRule == null) { + conversionRule = new ArrayList>(); + } + return this.conversionRule; + } + +} diff --git a/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/ConversionRule.java b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/ConversionRule.java new file mode 100644 index 0000000..068745f --- /dev/null +++ b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/ConversionRule.java @@ -0,0 +1,45 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.11.25 at 04:57:27 PM EET +// + + +package org.simantics.xml.sax.configuration; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for ConversionRule complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="ConversionRule">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ConversionRule") +@XmlSeeAlso({ + IDProvider.class, + UnrecognizedChildElement.class, + OrderedChild.class, + AttributeComposition.class, + IDReference.class +}) +public class ConversionRule { + + +} diff --git a/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/Element.java b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/Element.java new file mode 100644 index 0000000..00bf583 --- /dev/null +++ b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/Element.java @@ -0,0 +1,65 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.11.25 at 04:57:27 PM EET +// + + +package org.simantics.xml.sax.configuration; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for Element complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="Element">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="Name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Element") +public class Element { + + @XmlAttribute(name = "Name") + protected String name; + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/IDProvider.java b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/IDProvider.java new file mode 100644 index 0000000..4031f24 --- /dev/null +++ b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/IDProvider.java @@ -0,0 +1,158 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.11.25 at 04:57:27 PM EET +// + + +package org.simantics.xml.sax.configuration; + +import java.math.BigInteger; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.simantics.org/xml/sax/configuration/}ConversionRule">
+ *       <sequence>
+ *         <choice>
+ *           <element ref="{http://www.simantics.org/xml/sax/configuration/}Element"/>
+ *           <element ref="{http://www.simantics.org/xml/sax/configuration/}ComplexType"/>
+ *         </choice>
+ *         <element ref="{http://www.simantics.org/xml/sax/configuration/}Attribute"/>
+ *       </sequence>
+ *       <attribute name="Priority" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "element", + "complexType", + "attribute" +}) +public class IDProvider + extends ConversionRule +{ + + @XmlElement(name = "Element") + protected Element element; + @XmlElement(name = "ComplexType") + protected ComplexType complexType; + @XmlElement(name = "Attribute", required = true) + protected Attribute attribute; + @XmlAttribute(name = "Priority") + protected BigInteger priority; + + /** + * Gets the value of the element property. + * + * @return + * possible object is + * {@link Element } + * + */ + public Element getElement() { + return element; + } + + /** + * Sets the value of the element property. + * + * @param value + * allowed object is + * {@link Element } + * + */ + public void setElement(Element value) { + this.element = value; + } + + /** + * Gets the value of the complexType property. + * + * @return + * possible object is + * {@link ComplexType } + * + */ + public ComplexType getComplexType() { + return complexType; + } + + /** + * Sets the value of the complexType property. + * + * @param value + * allowed object is + * {@link ComplexType } + * + */ + public void setComplexType(ComplexType value) { + this.complexType = value; + } + + /** + * Gets the value of the attribute property. + * + * @return + * possible object is + * {@link Attribute } + * + */ + public Attribute getAttribute() { + return attribute; + } + + /** + * Sets the value of the attribute property. + * + * @param value + * allowed object is + * {@link Attribute } + * + */ + public void setAttribute(Attribute value) { + this.attribute = value; + } + + /** + * Gets the value of the priority property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getPriority() { + return priority; + } + + /** + * Sets the value of the priority property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setPriority(BigInteger value) { + this.priority = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/IDReference.java b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/IDReference.java new file mode 100644 index 0000000..e48ca71 --- /dev/null +++ b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/IDReference.java @@ -0,0 +1,157 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.11.25 at 04:57:27 PM EET +// + + +package org.simantics.xml.sax.configuration; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.simantics.org/xml/sax/configuration/}ConversionRule">
+ *       <sequence>
+ *         <choice>
+ *           <element ref="{http://www.simantics.org/xml/sax/configuration/}Element"/>
+ *           <element ref="{http://www.simantics.org/xml/sax/configuration/}ComplexType"/>
+ *         </choice>
+ *         <element name="IDSource" type="{http://www.simantics.org/xml/sax/configuration/}Attribute"/>
+ *         <element name="Reference" type="{http://www.simantics.org/xml/sax/configuration/}Attribute"/>
+ *       </sequence>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "element", + "complexType", + "idSource", + "reference" +}) +public class IDReference + extends ConversionRule +{ + + @XmlElement(name = "Element") + protected Element element; + @XmlElement(name = "ComplexType") + protected ComplexType complexType; + @XmlElement(name = "IDSource", required = true) + protected Attribute idSource; + @XmlElement(name = "Reference", required = true) + protected Attribute reference; + + /** + * Gets the value of the element property. + * + * @return + * possible object is + * {@link Element } + * + */ + public Element getElement() { + return element; + } + + /** + * Sets the value of the element property. + * + * @param value + * allowed object is + * {@link Element } + * + */ + public void setElement(Element value) { + this.element = value; + } + + /** + * Gets the value of the complexType property. + * + * @return + * possible object is + * {@link ComplexType } + * + */ + public ComplexType getComplexType() { + return complexType; + } + + /** + * Sets the value of the complexType property. + * + * @param value + * allowed object is + * {@link ComplexType } + * + */ + public void setComplexType(ComplexType value) { + this.complexType = value; + } + + /** + * Gets the value of the idSource property. + * + * @return + * possible object is + * {@link Attribute } + * + */ + public Attribute getIDSource() { + return idSource; + } + + /** + * Sets the value of the idSource property. + * + * @param value + * allowed object is + * {@link Attribute } + * + */ + public void setIDSource(Attribute value) { + this.idSource = value; + } + + /** + * Gets the value of the reference property. + * + * @return + * possible object is + * {@link Attribute } + * + */ + public Attribute getReference() { + return reference; + } + + /** + * Sets the value of the reference property. + * + * @param value + * allowed object is + * {@link Attribute } + * + */ + public void setReference(Attribute value) { + this.reference = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/ObjectFactory.java b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/ObjectFactory.java new file mode 100644 index 0000000..2dfe1e4 --- /dev/null +++ b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/ObjectFactory.java @@ -0,0 +1,222 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.11.25 at 04:57:27 PM EET +// + + +package org.simantics.xml.sax.configuration; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the org.simantics.xml.sax.configuration package. + *

An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _ComplexType_QNAME = new QName("http://www.simantics.org/xml/sax/configuration/", "ComplexType"); + private final static QName _IDProvider_QNAME = new QName("http://www.simantics.org/xml/sax/configuration/", "IDProvider"); + private final static QName _ConversionRule_QNAME = new QName("http://www.simantics.org/xml/sax/configuration/", "ConversionRule"); + private final static QName _Attribute_QNAME = new QName("http://www.simantics.org/xml/sax/configuration/", "Attribute"); + private final static QName _UnrecognizedChildElement_QNAME = new QName("http://www.simantics.org/xml/sax/configuration/", "UnrecognizedChildElement"); + private final static QName _OrderedChild_QNAME = new QName("http://www.simantics.org/xml/sax/configuration/", "OrderedChild"); + private final static QName _Configuration_QNAME = new QName("http://www.simantics.org/xml/sax/configuration/", "Configuration"); + private final static QName _Element_QNAME = new QName("http://www.simantics.org/xml/sax/configuration/", "Element"); + private final static QName _AttributeComposition_QNAME = new QName("http://www.simantics.org/xml/sax/configuration/", "AttributeComposition"); + private final static QName _IDReference_QNAME = new QName("http://www.simantics.org/xml/sax/configuration/", "IDReference"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.simantics.xml.sax.configuration + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link ConversionRule } + * + */ + public ConversionRule createConversionRule() { + return new ConversionRule(); + } + + /** + * Create an instance of {@link IDProvider } + * + */ + public IDProvider createIDProvider() { + return new IDProvider(); + } + + /** + * Create an instance of {@link Configuration } + * + */ + public Configuration createConfiguration() { + return new Configuration(); + } + + /** + * Create an instance of {@link Attribute } + * + */ + public Attribute createAttribute() { + return new Attribute(); + } + + /** + * Create an instance of {@link UnrecognizedChildElement } + * + */ + public UnrecognizedChildElement createUnrecognizedChildElement() { + return new UnrecognizedChildElement(); + } + + /** + * Create an instance of {@link OrderedChild } + * + */ + public OrderedChild createOrderedChild() { + return new OrderedChild(); + } + + /** + * Create an instance of {@link AttributeComposition } + * + */ + public AttributeComposition createAttributeComposition() { + return new AttributeComposition(); + } + + /** + * Create an instance of {@link IDReference } + * + */ + public IDReference createIDReference() { + return new IDReference(); + } + + /** + * Create an instance of {@link Element } + * + */ + public Element createElement() { + return new Element(); + } + + /** + * Create an instance of {@link ComplexType } + * + */ + public ComplexType createComplexType() { + return new ComplexType(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ComplexType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.simantics.org/xml/sax/configuration/", name = "ComplexType") + public JAXBElement createComplexType(ComplexType value) { + return new JAXBElement(_ComplexType_QNAME, ComplexType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link IDProvider }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.simantics.org/xml/sax/configuration/", name = "IDProvider", substitutionHeadNamespace = "http://www.simantics.org/xml/sax/configuration/", substitutionHeadName = "ConversionRule") + public JAXBElement createIDProvider(IDProvider value) { + return new JAXBElement(_IDProvider_QNAME, IDProvider.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ConversionRule }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.simantics.org/xml/sax/configuration/", name = "ConversionRule") + public JAXBElement createConversionRule(ConversionRule value) { + return new JAXBElement(_ConversionRule_QNAME, ConversionRule.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Attribute }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.simantics.org/xml/sax/configuration/", name = "Attribute") + public JAXBElement createAttribute(Attribute value) { + return new JAXBElement(_Attribute_QNAME, Attribute.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link UnrecognizedChildElement }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.simantics.org/xml/sax/configuration/", name = "UnrecognizedChildElement", substitutionHeadNamespace = "http://www.simantics.org/xml/sax/configuration/", substitutionHeadName = "ConversionRule") + public JAXBElement createUnrecognizedChildElement(UnrecognizedChildElement value) { + return new JAXBElement(_UnrecognizedChildElement_QNAME, UnrecognizedChildElement.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link OrderedChild }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.simantics.org/xml/sax/configuration/", name = "OrderedChild", substitutionHeadNamespace = "http://www.simantics.org/xml/sax/configuration/", substitutionHeadName = "ConversionRule") + public JAXBElement createOrderedChild(OrderedChild value) { + return new JAXBElement(_OrderedChild_QNAME, OrderedChild.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Configuration }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.simantics.org/xml/sax/configuration/", name = "Configuration") + public JAXBElement createConfiguration(Configuration value) { + return new JAXBElement(_Configuration_QNAME, Configuration.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Element }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.simantics.org/xml/sax/configuration/", name = "Element") + public JAXBElement createElement(Element value) { + return new JAXBElement(_Element_QNAME, Element.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link AttributeComposition }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.simantics.org/xml/sax/configuration/", name = "AttributeComposition", substitutionHeadNamespace = "http://www.simantics.org/xml/sax/configuration/", substitutionHeadName = "ConversionRule") + public JAXBElement createAttributeComposition(AttributeComposition value) { + return new JAXBElement(_AttributeComposition_QNAME, AttributeComposition.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link IDReference }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.simantics.org/xml/sax/configuration/", name = "IDReference", substitutionHeadNamespace = "http://www.simantics.org/xml/sax/configuration/", substitutionHeadName = "ConversionRule") + public JAXBElement createIDReference(IDReference value) { + return new JAXBElement(_IDReference_QNAME, IDReference.class, null, value); + } + +} diff --git a/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/OrderedChild.java b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/OrderedChild.java new file mode 100644 index 0000000..fb9f498 --- /dev/null +++ b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/OrderedChild.java @@ -0,0 +1,184 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.11.25 at 04:57:27 PM EET +// + + +package org.simantics.xml.sax.configuration; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.simantics.org/xml/sax/configuration/}ConversionRule">
+ *       <sequence>
+ *         <choice>
+ *           <element ref="{http://www.simantics.org/xml/sax/configuration/}Element"/>
+ *           <element ref="{http://www.simantics.org/xml/sax/configuration/}ComplexType"/>
+ *         </choice>
+ *         <element name="Child" type="{http://www.simantics.org/xml/sax/configuration/}Element" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="Type" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="Value" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "element", + "complexType", + "child" +}) +public class OrderedChild + extends ConversionRule +{ + + @XmlElement(name = "Element") + protected Element element; + @XmlElement(name = "ComplexType") + protected ComplexType complexType; + @XmlElement(name = "Child") + protected Element child; + @XmlAttribute(name = "Type") + protected String type; + @XmlAttribute(name = "Value") + protected String value; + + /** + * Gets the value of the element property. + * + * @return + * possible object is + * {@link Element } + * + */ + public Element getElement() { + return element; + } + + /** + * Sets the value of the element property. + * + * @param value + * allowed object is + * {@link Element } + * + */ + public void setElement(Element value) { + this.element = value; + } + + /** + * Gets the value of the complexType property. + * + * @return + * possible object is + * {@link ComplexType } + * + */ + public ComplexType getComplexType() { + return complexType; + } + + /** + * Sets the value of the complexType property. + * + * @param value + * allowed object is + * {@link ComplexType } + * + */ + public void setComplexType(ComplexType value) { + this.complexType = value; + } + + /** + * Gets the value of the child property. + * + * @return + * possible object is + * {@link Element } + * + */ + public Element getChild() { + return child; + } + + /** + * Sets the value of the child property. + * + * @param value + * allowed object is + * {@link Element } + * + */ + public void setChild(Element value) { + this.child = value; + } + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/UnrecognizedChildElement.java b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/UnrecognizedChildElement.java new file mode 100644 index 0000000..4874867 --- /dev/null +++ b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/UnrecognizedChildElement.java @@ -0,0 +1,129 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.11.25 at 04:57:27 PM EET +// + + +package org.simantics.xml.sax.configuration; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.simantics.org/xml/sax/configuration/}ConversionRule">
+ *       <sequence>
+ *         <choice>
+ *           <element ref="{http://www.simantics.org/xml/sax/configuration/}Element"/>
+ *           <element ref="{http://www.simantics.org/xml/sax/configuration/}ComplexType"/>
+ *         </choice>
+ *         <element name="JavaMethod" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "element", + "complexType", + "javaMethod" +}) +public class UnrecognizedChildElement + extends ConversionRule +{ + + @XmlElement(name = "Element") + protected Element element; + @XmlElement(name = "ComplexType") + protected ComplexType complexType; + @XmlElement(name = "JavaMethod", required = true) + protected String javaMethod; + + /** + * Gets the value of the element property. + * + * @return + * possible object is + * {@link Element } + * + */ + public Element getElement() { + return element; + } + + /** + * Sets the value of the element property. + * + * @param value + * allowed object is + * {@link Element } + * + */ + public void setElement(Element value) { + this.element = value; + } + + /** + * Gets the value of the complexType property. + * + * @return + * possible object is + * {@link ComplexType } + * + */ + public ComplexType getComplexType() { + return complexType; + } + + /** + * Sets the value of the complexType property. + * + * @param value + * allowed object is + * {@link ComplexType } + * + */ + public void setComplexType(ComplexType value) { + this.complexType = value; + } + + /** + * Gets the value of the javaMethod property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getJavaMethod() { + return javaMethod; + } + + /** + * Sets the value of the javaMethod property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setJavaMethod(String value) { + this.javaMethod = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/package-info.java b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/package-info.java new file mode 100644 index 0000000..dd605be --- /dev/null +++ b/org.simantics.xml.sax/src/org/simantics/xml/sax/configuration/package-info.java @@ -0,0 +1,9 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.11.25 at 04:57:27 PM EET +// + +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.simantics.org/xml/sax/configuration/", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +package org.simantics.xml.sax.configuration; diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/All.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/All.java new file mode 100644 index 0000000..17ce24c --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/All.java @@ -0,0 +1,59 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + * + * Only elements allowed inside + * + *

Java class for all complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="all">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}explicitGroup">
+ *       <group ref="{http://www.w3.org/2001/XMLSchema}allModel"/>
+ *       <attribute name="minOccurs" default="1">
+ *         <simpleType>
+ *           <restriction base="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger">
+ *             <enumeration value="0"/>
+ *             <enumeration value="1"/>
+ *           </restriction>
+ *         </simpleType>
+ *       </attribute>
+ *       <attribute name="maxOccurs" default="1">
+ *         <simpleType>
+ *           <restriction base="{http://www.w3.org/2001/XMLSchema}allNNI">
+ *             <enumeration value="1"/>
+ *           </restriction>
+ *         </simpleType>
+ *       </attribute>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "all") +public class All + extends ExplicitGroup +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Annotated.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Annotated.java new file mode 100644 index 0000000..47d8291 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Annotated.java @@ -0,0 +1,134 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + + +/** + * + * This type is extended by all types which allow annotation + * other than itself + * + * + *

Java class for annotated complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="annotated">
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}openAttrs">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "annotated", propOrder = { + "annotation" +}) +@XmlSeeAlso({ + ExtensionType.class, + Element.class, + AttributeGroup.class, + ComplexType.class, + Attribute.class, + RestrictionType.class, + SimpleType.class, + Group.class, + SimpleContent.class, + List.class, + Restriction.class, + Facet.class, + Wildcard.class, + Union.class, + Notation.class, + Import.class, + Include.class, + Field.class, + Keybase.class, + ComplexContent.class, + Selector.class +}) +public class Annotated + extends OpenAttrs +{ + + protected Annotation annotation; + @XmlAttribute(name = "id") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + + /** + * Gets the value of the annotation property. + * + * @return + * possible object is + * {@link Annotation } + * + */ + public Annotation getAnnotation() { + return annotation; + } + + /** + * Sets the value of the annotation property. + * + * @param value + * allowed object is + * {@link Annotation } + * + */ + public void setAnnotation(Annotation value) { + this.annotation = value; + } + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Annotation.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Annotation.java new file mode 100644 index 0000000..4756dba --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Annotation.java @@ -0,0 +1,122 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElements; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}openAttrs">
+ *       <choice maxOccurs="unbounded" minOccurs="0">
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}appinfo"/>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}documentation"/>
+ *       </choice>
+ *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "appinfoOrDocumentation" +}) +@XmlRootElement(name = "annotation") +public class Annotation + extends OpenAttrs +{ + + @XmlElements({ + @XmlElement(name = "appinfo", type = Appinfo.class), + @XmlElement(name = "documentation", type = Documentation.class) + }) + protected List appinfoOrDocumentation; + @XmlAttribute(name = "id") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + + /** + * Gets the value of the appinfoOrDocumentation property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the appinfoOrDocumentation property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getAppinfoOrDocumentation().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Appinfo } + * {@link Documentation } + * + * + */ + public List getAppinfoOrDocumentation() { + if (appinfoOrDocumentation == null) { + appinfoOrDocumentation = new ArrayList(); + } + return this.appinfoOrDocumentation; + } + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Any.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Any.java new file mode 100644 index 0000000..7f489e7 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Any.java @@ -0,0 +1,108 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import java.math.BigInteger; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}wildcard">
+ *       <attGroup ref="{http://www.w3.org/2001/XMLSchema}occurs"/>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@XmlRootElement(name = "any") +public class Any + extends Wildcard +{ + + @XmlAttribute(name = "minOccurs") + @XmlSchemaType(name = "nonNegativeInteger") + protected BigInteger minOccurs; + @XmlAttribute(name = "maxOccurs") + @XmlSchemaType(name = "allNNI") + protected String maxOccurs; + + /** + * Gets the value of the minOccurs property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getMinOccurs() { + if (minOccurs == null) { + return new BigInteger("1"); + } else { + return minOccurs; + } + } + + /** + * Sets the value of the minOccurs property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setMinOccurs(BigInteger value) { + this.minOccurs = value; + } + + /** + * Gets the value of the maxOccurs property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMaxOccurs() { + if (maxOccurs == null) { + return "1"; + } else { + return maxOccurs; + } + } + + /** + * Sets the value of the maxOccurs property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMaxOccurs(String value) { + this.maxOccurs = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Appinfo.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Appinfo.java new file mode 100644 index 0000000..746a942 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Appinfo.java @@ -0,0 +1,138 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlMixed; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence maxOccurs="unbounded" minOccurs="0">
+ *         <any processContents='lax'/>
+ *       </sequence>
+ *       <attribute name="source" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "content" +}) +@XmlRootElement(name = "appinfo") +public class Appinfo { + + @XmlMixed + @XmlAnyElement(lax = true) + protected List content; + @XmlAttribute(name = "source") + @XmlSchemaType(name = "anyURI") + protected String source; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getContent().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Object } + * {@link String } + * {@link Element } + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + + /** + * Gets the value of the source property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSource() { + return source; + } + + /** + * Sets the value of the source property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSource(String value) { + this.source = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Attribute.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Attribute.java new file mode 100644 index 0000000..4121ed3 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Attribute.java @@ -0,0 +1,282 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + + +/** + *

Java class for attribute complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="attribute">
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <sequence>
+ *         <element name="simpleType" type="{http://www.w3.org/2001/XMLSchema}localSimpleType" minOccurs="0"/>
+ *       </sequence>
+ *       <attGroup ref="{http://www.w3.org/2001/XMLSchema}defRef"/>
+ *       <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}QName" />
+ *       <attribute name="use" default="optional">
+ *         <simpleType>
+ *           <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+ *             <enumeration value="prohibited"/>
+ *             <enumeration value="optional"/>
+ *             <enumeration value="required"/>
+ *           </restriction>
+ *         </simpleType>
+ *       </attribute>
+ *       <attribute name="default" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="fixed" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="form" type="{http://www.w3.org/2001/XMLSchema}formChoice" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "attribute", propOrder = { + "simpleType" +}) +@XmlSeeAlso({ + TopLevelAttribute.class +}) +public class Attribute + extends Annotated +{ + + protected LocalSimpleType simpleType; + @XmlAttribute(name = "type") + protected QName type; + @XmlAttribute(name = "use") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + protected String use; + @XmlAttribute(name = "default") + protected String _default; + @XmlAttribute(name = "fixed") + protected String fixed; + @XmlAttribute(name = "form") + protected FormChoice form; + @XmlAttribute(name = "name") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NCName") + protected String name; + @XmlAttribute(name = "ref") + protected QName ref; + + /** + * Gets the value of the simpleType property. + * + * @return + * possible object is + * {@link LocalSimpleType } + * + */ + public LocalSimpleType getSimpleType() { + return simpleType; + } + + /** + * Sets the value of the simpleType property. + * + * @param value + * allowed object is + * {@link LocalSimpleType } + * + */ + public void setSimpleType(LocalSimpleType value) { + this.simpleType = value; + } + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link QName } + * + */ + public QName getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link QName } + * + */ + public void setType(QName value) { + this.type = value; + } + + /** + * Gets the value of the use property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getUse() { + if (use == null) { + return "optional"; + } else { + return use; + } + } + + /** + * Sets the value of the use property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setUse(String value) { + this.use = value; + } + + /** + * Gets the value of the default property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDefault() { + return _default; + } + + /** + * Sets the value of the default property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDefault(String value) { + this._default = value; + } + + /** + * Gets the value of the fixed property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getFixed() { + return fixed; + } + + /** + * Sets the value of the fixed property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFixed(String value) { + this.fixed = value; + } + + /** + * Gets the value of the form property. + * + * @return + * possible object is + * {@link FormChoice } + * + */ + public FormChoice getForm() { + return form; + } + + /** + * Sets the value of the form property. + * + * @param value + * allowed object is + * {@link FormChoice } + * + */ + public void setForm(FormChoice value) { + this.form = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the ref property. + * + * @return + * possible object is + * {@link QName } + * + */ + public QName getRef() { + return ref; + } + + /** + * Sets the value of the ref property. + * + * @param value + * allowed object is + * {@link QName } + * + */ + public void setRef(QName value) { + this.ref = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/AttributeGroup.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/AttributeGroup.java new file mode 100644 index 0000000..a812291 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/AttributeGroup.java @@ -0,0 +1,173 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElements; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + + +/** + *

Java class for attributeGroup complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="attributeGroup">
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <group ref="{http://www.w3.org/2001/XMLSchema}attrDecls"/>
+ *       <attGroup ref="{http://www.w3.org/2001/XMLSchema}defRef"/>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "attributeGroup", propOrder = { + "attributeOrAttributeGroup", + "anyAttribute" +}) +@XmlSeeAlso({ + NamedAttributeGroup.class, + AttributeGroupRef.class +}) +public abstract class AttributeGroup + extends Annotated +{ + + @XmlElements({ + @XmlElement(name = "attribute", type = Attribute.class), + @XmlElement(name = "attributeGroup", type = AttributeGroupRef.class) + }) + protected List attributeOrAttributeGroup; + protected Wildcard anyAttribute; + @XmlAttribute(name = "name") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NCName") + protected String name; + @XmlAttribute(name = "ref") + protected QName ref; + + /** + * Gets the value of the attributeOrAttributeGroup property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the attributeOrAttributeGroup property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getAttributeOrAttributeGroup().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Attribute } + * {@link AttributeGroupRef } + * + * + */ + public List getAttributeOrAttributeGroup() { + if (attributeOrAttributeGroup == null) { + attributeOrAttributeGroup = new ArrayList(); + } + return this.attributeOrAttributeGroup; + } + + /** + * Gets the value of the anyAttribute property. + * + * @return + * possible object is + * {@link Wildcard } + * + */ + public Wildcard getAnyAttribute() { + return anyAttribute; + } + + /** + * Sets the value of the anyAttribute property. + * + * @param value + * allowed object is + * {@link Wildcard } + * + */ + public void setAnyAttribute(Wildcard value) { + this.anyAttribute = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the ref property. + * + * @return + * possible object is + * {@link QName } + * + */ + public QName getRef() { + return ref; + } + + /** + * Sets the value of the ref property. + * + * @param value + * allowed object is + * {@link QName } + * + */ + public void setRef(QName value) { + this.ref = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/AttributeGroupRef.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/AttributeGroupRef.java new file mode 100644 index 0000000..24952ff --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/AttributeGroupRef.java @@ -0,0 +1,44 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for attributeGroupRef complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="attributeGroupRef">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}attributeGroup">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "attributeGroupRef") +public class AttributeGroupRef + extends AttributeGroup +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ComplexContent.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ComplexContent.java new file mode 100644 index 0000000..221b17a --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ComplexContent.java @@ -0,0 +1,127 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <choice>
+ *         <element name="restriction" type="{http://www.w3.org/2001/XMLSchema}complexRestrictionType"/>
+ *         <element name="extension" type="{http://www.w3.org/2001/XMLSchema}extensionType"/>
+ *       </choice>
+ *       <attribute name="mixed" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "restriction", + "extension" +}) +@XmlRootElement(name = "complexContent") +public class ComplexContent + extends Annotated +{ + + protected ComplexRestrictionType restriction; + protected ExtensionType extension; + @XmlAttribute(name = "mixed") + protected Boolean mixed; + + /** + * Gets the value of the restriction property. + * + * @return + * possible object is + * {@link ComplexRestrictionType } + * + */ + public ComplexRestrictionType getRestriction() { + return restriction; + } + + /** + * Sets the value of the restriction property. + * + * @param value + * allowed object is + * {@link ComplexRestrictionType } + * + */ + public void setRestriction(ComplexRestrictionType value) { + this.restriction = value; + } + + /** + * Gets the value of the extension property. + * + * @return + * possible object is + * {@link ExtensionType } + * + */ + public ExtensionType getExtension() { + return extension; + } + + /** + * Sets the value of the extension property. + * + * @param value + * allowed object is + * {@link ExtensionType } + * + */ + public void setExtension(ExtensionType value) { + this.extension = value; + } + + /** + * Gets the value of the mixed property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isMixed() { + return mixed; + } + + /** + * Sets the value of the mixed property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setMixed(Boolean value) { + this.mixed = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ComplexRestrictionType.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ComplexRestrictionType.java new file mode 100644 index 0000000..2472bbb --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ComplexRestrictionType.java @@ -0,0 +1,47 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for complexRestrictionType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="complexRestrictionType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}restrictionType">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *         <choice minOccurs="0">
+ *           <group ref="{http://www.w3.org/2001/XMLSchema}typeDefParticle"/>
+ *         </choice>
+ *         <group ref="{http://www.w3.org/2001/XMLSchema}attrDecls"/>
+ *       </sequence>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "complexRestrictionType") +public class ComplexRestrictionType + extends RestrictionType +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ComplexType.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ComplexType.java new file mode 100644 index 0000000..579b46b --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ComplexType.java @@ -0,0 +1,430 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElements; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + + +/** + *

Java class for complexType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="complexType">
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <group ref="{http://www.w3.org/2001/XMLSchema}complexTypeModel"/>
+ *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}NCName" />
+ *       <attribute name="mixed" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *       <attribute name="abstract" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *       <attribute name="final" type="{http://www.w3.org/2001/XMLSchema}derivationSet" />
+ *       <attribute name="block" type="{http://www.w3.org/2001/XMLSchema}derivationSet" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "complexType", propOrder = { + "simpleContent", + "complexContent", + "group", + "all", + "choice", + "sequence", + "attributeOrAttributeGroup", + "anyAttribute" +}) +@XmlSeeAlso({ + TopLevelComplexType.class, + LocalComplexType.class +}) +public abstract class ComplexType + extends Annotated +{ + + protected SimpleContent simpleContent; + protected ComplexContent complexContent; + protected GroupRef group; + protected All all; + protected ExplicitGroup choice; + protected ExplicitGroup sequence; + @XmlElements({ + @XmlElement(name = "attribute", type = Attribute.class), + @XmlElement(name = "attributeGroup", type = AttributeGroupRef.class) + }) + protected List attributeOrAttributeGroup; + protected Wildcard anyAttribute; + @XmlAttribute(name = "name") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NCName") + protected String name; + @XmlAttribute(name = "mixed") + protected Boolean mixed; + @XmlAttribute(name = "abstract") + protected Boolean _abstract; + @XmlAttribute(name = "final") + @XmlSchemaType(name = "derivationSet") + protected List _final; + @XmlAttribute(name = "block") + @XmlSchemaType(name = "derivationSet") + protected List block; + + /** + * Gets the value of the simpleContent property. + * + * @return + * possible object is + * {@link SimpleContent } + * + */ + public SimpleContent getSimpleContent() { + return simpleContent; + } + + /** + * Sets the value of the simpleContent property. + * + * @param value + * allowed object is + * {@link SimpleContent } + * + */ + public void setSimpleContent(SimpleContent value) { + this.simpleContent = value; + } + + /** + * Gets the value of the complexContent property. + * + * @return + * possible object is + * {@link ComplexContent } + * + */ + public ComplexContent getComplexContent() { + return complexContent; + } + + /** + * Sets the value of the complexContent property. + * + * @param value + * allowed object is + * {@link ComplexContent } + * + */ + public void setComplexContent(ComplexContent value) { + this.complexContent = value; + } + + /** + * Gets the value of the group property. + * + * @return + * possible object is + * {@link GroupRef } + * + */ + public GroupRef getGroup() { + return group; + } + + /** + * Sets the value of the group property. + * + * @param value + * allowed object is + * {@link GroupRef } + * + */ + public void setGroup(GroupRef value) { + this.group = value; + } + + /** + * Gets the value of the all property. + * + * @return + * possible object is + * {@link All } + * + */ + public All getAll() { + return all; + } + + /** + * Sets the value of the all property. + * + * @param value + * allowed object is + * {@link All } + * + */ + public void setAll(All value) { + this.all = value; + } + + /** + * Gets the value of the choice property. + * + * @return + * possible object is + * {@link ExplicitGroup } + * + */ + public ExplicitGroup getChoice() { + return choice; + } + + /** + * Sets the value of the choice property. + * + * @param value + * allowed object is + * {@link ExplicitGroup } + * + */ + public void setChoice(ExplicitGroup value) { + this.choice = value; + } + + /** + * Gets the value of the sequence property. + * + * @return + * possible object is + * {@link ExplicitGroup } + * + */ + public ExplicitGroup getSequence() { + return sequence; + } + + /** + * Sets the value of the sequence property. + * + * @param value + * allowed object is + * {@link ExplicitGroup } + * + */ + public void setSequence(ExplicitGroup value) { + this.sequence = value; + } + + /** + * Gets the value of the attributeOrAttributeGroup property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the attributeOrAttributeGroup property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getAttributeOrAttributeGroup().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Attribute } + * {@link AttributeGroupRef } + * + * + */ + public List getAttributeOrAttributeGroup() { + if (attributeOrAttributeGroup == null) { + attributeOrAttributeGroup = new ArrayList(); + } + return this.attributeOrAttributeGroup; + } + + /** + * Gets the value of the anyAttribute property. + * + * @return + * possible object is + * {@link Wildcard } + * + */ + public Wildcard getAnyAttribute() { + return anyAttribute; + } + + /** + * Sets the value of the anyAttribute property. + * + * @param value + * allowed object is + * {@link Wildcard } + * + */ + public void setAnyAttribute(Wildcard value) { + this.anyAttribute = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the mixed property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public boolean isMixed() { + if (mixed == null) { + return false; + } else { + return mixed; + } + } + + /** + * Sets the value of the mixed property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setMixed(Boolean value) { + this.mixed = value; + } + + /** + * Gets the value of the abstract property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public boolean isAbstract() { + if (_abstract == null) { + return false; + } else { + return _abstract; + } + } + + /** + * Sets the value of the abstract property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setAbstract(Boolean value) { + this._abstract = value; + } + + /** + * Gets the value of the final property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the final property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getFinal().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getFinal() { + if (_final == null) { + _final = new ArrayList(); + } + return this._final; + } + + /** + * Gets the value of the block property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the block property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getBlock().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getBlock() { + if (block == null) { + block = new ArrayList(); + } + return this.block; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/DerivationControl.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/DerivationControl.java new file mode 100644 index 0000000..4634178 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/DerivationControl.java @@ -0,0 +1,67 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for derivationControl. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="derivationControl">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+ *     <enumeration value="substitution"/>
+ *     <enumeration value="extension"/>
+ *     <enumeration value="restriction"/>
+ *     <enumeration value="list"/>
+ *     <enumeration value="union"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "derivationControl") +@XmlEnum +public enum DerivationControl { + + @XmlEnumValue("substitution") + SUBSTITUTION("substitution"), + @XmlEnumValue("extension") + EXTENSION("extension"), + @XmlEnumValue("restriction") + RESTRICTION("restriction"), + @XmlEnumValue("list") + LIST("list"), + @XmlEnumValue("union") + UNION("union"); + private final String value; + + DerivationControl(String v) { + value = v; + } + + public String value() { + return value; + } + + public static DerivationControl fromValue(String v) { + for (DerivationControl c: DerivationControl.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Documentation.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Documentation.java new file mode 100644 index 0000000..485eb2e --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Documentation.java @@ -0,0 +1,165 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlMixed; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence maxOccurs="unbounded" minOccurs="0">
+ *         <any processContents='lax'/>
+ *       </sequence>
+ *       <attribute name="source" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *       <attribute ref="{http://www.w3.org/XML/1998/namespace}lang"/>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "content" +}) +@XmlRootElement(name = "documentation") +public class Documentation { + + @XmlMixed + @XmlAnyElement(lax = true) + protected List content; + @XmlAttribute(name = "source") + @XmlSchemaType(name = "anyURI") + protected String source; + @XmlAttribute(name = "lang", namespace = "http://www.w3.org/XML/1998/namespace") + protected String lang; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getContent().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Object } + * {@link String } + * {@link Element } + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + + /** + * Gets the value of the source property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSource() { + return source; + } + + /** + * Sets the value of the source property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSource(String value) { + this.source = value; + } + + /** + * Gets the value of the lang property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLang() { + return lang; + } + + /** + * Sets the value of the lang property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLang(String value) { + this.lang = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Element.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Element.java new file mode 100644 index 0000000..b24e388 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Element.java @@ -0,0 +1,542 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + + +/** + * + * The element element can be used either + * at the top level to define an element-type binding globally, + * or within a content model to either reference a globally-defined + * element or type or declare an element-type binding locally. + * The ref form is not allowed at the top level. + * + *

Java class for element complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="element">
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <sequence>
+ *         <choice minOccurs="0">
+ *           <element name="simpleType" type="{http://www.w3.org/2001/XMLSchema}localSimpleType"/>
+ *           <element name="complexType" type="{http://www.w3.org/2001/XMLSchema}localComplexType"/>
+ *         </choice>
+ *         <group ref="{http://www.w3.org/2001/XMLSchema}identityConstraint" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attGroup ref="{http://www.w3.org/2001/XMLSchema}defRef"/>
+ *       <attGroup ref="{http://www.w3.org/2001/XMLSchema}occurs"/>
+ *       <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}QName" />
+ *       <attribute name="substitutionGroup" type="{http://www.w3.org/2001/XMLSchema}QName" />
+ *       <attribute name="default" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="fixed" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="nillable" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *       <attribute name="abstract" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *       <attribute name="final" type="{http://www.w3.org/2001/XMLSchema}derivationSet" />
+ *       <attribute name="block" type="{http://www.w3.org/2001/XMLSchema}blockSet" />
+ *       <attribute name="form" type="{http://www.w3.org/2001/XMLSchema}formChoice" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "element", propOrder = { + "simpleType", + "complexType", + "identityConstraint" +}) +@XmlSeeAlso({ + TopLevelElement.class, + LocalElement.class +}) +public abstract class Element + extends Annotated +{ + + protected LocalSimpleType simpleType; + protected LocalComplexType complexType; + @XmlElementRefs({ + @XmlElementRef(name = "keyref", namespace = "http://www.w3.org/2001/XMLSchema", type = Keyref.class, required = false), + @XmlElementRef(name = "key", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "unique", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false) + }) + protected List identityConstraint; + @XmlAttribute(name = "type") + protected QName type; + @XmlAttribute(name = "substitutionGroup") + protected QName substitutionGroup; + @XmlAttribute(name = "default") + protected String _default; + @XmlAttribute(name = "fixed") + protected String fixed; + @XmlAttribute(name = "nillable") + protected Boolean nillable; + @XmlAttribute(name = "abstract") + protected Boolean _abstract; + @XmlAttribute(name = "final") + @XmlSchemaType(name = "derivationSet") + protected List _final; + @XmlAttribute(name = "block") + @XmlSchemaType(name = "blockSet") + protected List block; + @XmlAttribute(name = "form") + protected FormChoice form; + @XmlAttribute(name = "name") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NCName") + protected String name; + @XmlAttribute(name = "ref") + protected QName ref; + @XmlAttribute(name = "minOccurs") + @XmlSchemaType(name = "nonNegativeInteger") + protected BigInteger minOccurs; + @XmlAttribute(name = "maxOccurs") + @XmlSchemaType(name = "allNNI") + protected String maxOccurs; + + /** + * Gets the value of the simpleType property. + * + * @return + * possible object is + * {@link LocalSimpleType } + * + */ + public LocalSimpleType getSimpleType() { + return simpleType; + } + + /** + * Sets the value of the simpleType property. + * + * @param value + * allowed object is + * {@link LocalSimpleType } + * + */ + public void setSimpleType(LocalSimpleType value) { + this.simpleType = value; + } + + /** + * Gets the value of the complexType property. + * + * @return + * possible object is + * {@link LocalComplexType } + * + */ + public LocalComplexType getComplexType() { + return complexType; + } + + /** + * Sets the value of the complexType property. + * + * @param value + * allowed object is + * {@link LocalComplexType } + * + */ + public void setComplexType(LocalComplexType value) { + this.complexType = value; + } + + /** + * Gets the value of the identityConstraint property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the identityConstraint property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getIdentityConstraint().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link Keybase }{@code >} + * {@link Keyref } + * {@link JAXBElement }{@code <}{@link Keybase }{@code >} + * + * + */ + public List getIdentityConstraint() { + if (identityConstraint == null) { + identityConstraint = new ArrayList(); + } + return this.identityConstraint; + } + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link QName } + * + */ + public QName getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link QName } + * + */ + public void setType(QName value) { + this.type = value; + } + + /** + * Gets the value of the substitutionGroup property. + * + * @return + * possible object is + * {@link QName } + * + */ + public QName getSubstitutionGroup() { + return substitutionGroup; + } + + /** + * Sets the value of the substitutionGroup property. + * + * @param value + * allowed object is + * {@link QName } + * + */ + public void setSubstitutionGroup(QName value) { + this.substitutionGroup = value; + } + + /** + * Gets the value of the default property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDefault() { + return _default; + } + + /** + * Sets the value of the default property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDefault(String value) { + this._default = value; + } + + /** + * Gets the value of the fixed property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getFixed() { + return fixed; + } + + /** + * Sets the value of the fixed property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFixed(String value) { + this.fixed = value; + } + + /** + * Gets the value of the nillable property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public boolean isNillable() { + if (nillable == null) { + return false; + } else { + return nillable; + } + } + + /** + * Sets the value of the nillable property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setNillable(Boolean value) { + this.nillable = value; + } + + /** + * Gets the value of the abstract property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public boolean isAbstract() { + if (_abstract == null) { + return false; + } else { + return _abstract; + } + } + + /** + * Sets the value of the abstract property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setAbstract(Boolean value) { + this._abstract = value; + } + + /** + * Gets the value of the final property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the final property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getFinal().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getFinal() { + if (_final == null) { + _final = new ArrayList(); + } + return this._final; + } + + /** + * Gets the value of the block property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the block property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getBlock().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getBlock() { + if (block == null) { + block = new ArrayList(); + } + return this.block; + } + + /** + * Gets the value of the form property. + * + * @return + * possible object is + * {@link FormChoice } + * + */ + public FormChoice getForm() { + return form; + } + + /** + * Sets the value of the form property. + * + * @param value + * allowed object is + * {@link FormChoice } + * + */ + public void setForm(FormChoice value) { + this.form = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the ref property. + * + * @return + * possible object is + * {@link QName } + * + */ + public QName getRef() { + return ref; + } + + /** + * Sets the value of the ref property. + * + * @param value + * allowed object is + * {@link QName } + * + */ + public void setRef(QName value) { + this.ref = value; + } + + /** + * Gets the value of the minOccurs property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getMinOccurs() { + if (minOccurs == null) { + return new BigInteger("1"); + } else { + return minOccurs; + } + } + + /** + * Sets the value of the minOccurs property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setMinOccurs(BigInteger value) { + this.minOccurs = value; + } + + /** + * Gets the value of the maxOccurs property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMaxOccurs() { + if (maxOccurs == null) { + return "1"; + } else { + return maxOccurs; + } + } + + /** + * Sets the value of the maxOccurs property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMaxOccurs(String value) { + this.maxOccurs = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ExplicitGroup.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ExplicitGroup.java new file mode 100644 index 0000000..0f27a7b --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ExplicitGroup.java @@ -0,0 +1,52 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; + + +/** + * + * group type for the three kinds of group + * + *

Java class for explicitGroup complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="explicitGroup">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}group">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *         <group ref="{http://www.w3.org/2001/XMLSchema}nestedParticle" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "explicitGroup") +@XmlSeeAlso({ + All.class, + SimpleExplicitGroup.class +}) +public class ExplicitGroup + extends Group +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ExtensionType.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ExtensionType.java new file mode 100644 index 0000000..478e14c --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ExtensionType.java @@ -0,0 +1,248 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElements; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + + +/** + *

Java class for extensionType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="extensionType">
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <sequence>
+ *         <group ref="{http://www.w3.org/2001/XMLSchema}typeDefParticle" minOccurs="0"/>
+ *         <group ref="{http://www.w3.org/2001/XMLSchema}attrDecls"/>
+ *       </sequence>
+ *       <attribute name="base" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "extensionType", propOrder = { + "group", + "all", + "choice", + "sequence", + "attributeOrAttributeGroup", + "anyAttribute" +}) +@XmlSeeAlso({ + SimpleExtensionType.class +}) +public class ExtensionType + extends Annotated +{ + + protected GroupRef group; + protected All all; + protected ExplicitGroup choice; + protected ExplicitGroup sequence; + @XmlElements({ + @XmlElement(name = "attribute", type = Attribute.class), + @XmlElement(name = "attributeGroup", type = AttributeGroupRef.class) + }) + protected List attributeOrAttributeGroup; + protected Wildcard anyAttribute; + @XmlAttribute(name = "base", required = true) + protected QName base; + + /** + * Gets the value of the group property. + * + * @return + * possible object is + * {@link GroupRef } + * + */ + public GroupRef getGroup() { + return group; + } + + /** + * Sets the value of the group property. + * + * @param value + * allowed object is + * {@link GroupRef } + * + */ + public void setGroup(GroupRef value) { + this.group = value; + } + + /** + * Gets the value of the all property. + * + * @return + * possible object is + * {@link All } + * + */ + public All getAll() { + return all; + } + + /** + * Sets the value of the all property. + * + * @param value + * allowed object is + * {@link All } + * + */ + public void setAll(All value) { + this.all = value; + } + + /** + * Gets the value of the choice property. + * + * @return + * possible object is + * {@link ExplicitGroup } + * + */ + public ExplicitGroup getChoice() { + return choice; + } + + /** + * Sets the value of the choice property. + * + * @param value + * allowed object is + * {@link ExplicitGroup } + * + */ + public void setChoice(ExplicitGroup value) { + this.choice = value; + } + + /** + * Gets the value of the sequence property. + * + * @return + * possible object is + * {@link ExplicitGroup } + * + */ + public ExplicitGroup getSequence() { + return sequence; + } + + /** + * Sets the value of the sequence property. + * + * @param value + * allowed object is + * {@link ExplicitGroup } + * + */ + public void setSequence(ExplicitGroup value) { + this.sequence = value; + } + + /** + * Gets the value of the attributeOrAttributeGroup property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the attributeOrAttributeGroup property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getAttributeOrAttributeGroup().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Attribute } + * {@link AttributeGroupRef } + * + * + */ + public List getAttributeOrAttributeGroup() { + if (attributeOrAttributeGroup == null) { + attributeOrAttributeGroup = new ArrayList(); + } + return this.attributeOrAttributeGroup; + } + + /** + * Gets the value of the anyAttribute property. + * + * @return + * possible object is + * {@link Wildcard } + * + */ + public Wildcard getAnyAttribute() { + return anyAttribute; + } + + /** + * Sets the value of the anyAttribute property. + * + * @param value + * allowed object is + * {@link Wildcard } + * + */ + public void setAnyAttribute(Wildcard value) { + this.anyAttribute = value; + } + + /** + * Gets the value of the base property. + * + * @return + * possible object is + * {@link QName } + * + */ + public QName getBase() { + return base; + } + + /** + * Sets the value of the base property. + * + * @param value + * allowed object is + * {@link QName } + * + */ + public void setBase(QName value) { + this.base = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Facet.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Facet.java new file mode 100644 index 0000000..870314d --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Facet.java @@ -0,0 +1,107 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for facet complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="facet">
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
+ *       <attribute name="fixed" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "facet") +@XmlSeeAlso({ + NoFixedFacet.class, + NumFacet.class, + WhiteSpace.class +}) +public class Facet + extends Annotated +{ + + @XmlAttribute(name = "value", required = true) + @XmlSchemaType(name = "anySimpleType") + protected String value; + @XmlAttribute(name = "fixed") + protected Boolean fixed; + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets the value of the fixed property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public boolean isFixed() { + if (fixed == null) { + return false; + } else { + return fixed; + } + } + + /** + * Sets the value of the fixed property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setFixed(Boolean value) { + this.fixed = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Field.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Field.java new file mode 100644 index 0000000..72a62ac --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Field.java @@ -0,0 +1,79 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <attribute name="xpath" use="required">
+ *         <simpleType>
+ *           <restriction base="{http://www.w3.org/2001/XMLSchema}token">
+ *             <pattern value="(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*))))(\|(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*)))))*"/>
+ *           </restriction>
+ *         </simpleType>
+ *       </attribute>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@XmlRootElement(name = "field") +public class Field + extends Annotated +{ + + @XmlAttribute(name = "xpath", required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + protected String xpath; + + /** + * Gets the value of the xpath property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getXpath() { + return xpath; + } + + /** + * Sets the value of the xpath property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setXpath(String value) { + this.xpath = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/FormChoice.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/FormChoice.java new file mode 100644 index 0000000..832a65a --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/FormChoice.java @@ -0,0 +1,58 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for formChoice. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="formChoice">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+ *     <enumeration value="qualified"/>
+ *     <enumeration value="unqualified"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "formChoice") +@XmlEnum +public enum FormChoice { + + @XmlEnumValue("qualified") + QUALIFIED("qualified"), + @XmlEnumValue("unqualified") + UNQUALIFIED("unqualified"); + private final String value; + + FormChoice(String v) { + value = v; + } + + public String value() { + return value; + } + + public static FormChoice fromValue(String v) { + for (FormChoice c: FormChoice.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Group.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Group.java new file mode 100644 index 0000000..e603834 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Group.java @@ -0,0 +1,224 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + + +/** + * + * group type for explicit groups, named top-level groups and + * group references + * + *

Java class for group complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="group">
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <group ref="{http://www.w3.org/2001/XMLSchema}particle" maxOccurs="unbounded" minOccurs="0"/>
+ *       <attGroup ref="{http://www.w3.org/2001/XMLSchema}occurs"/>
+ *       <attGroup ref="{http://www.w3.org/2001/XMLSchema}defRef"/>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "group", propOrder = { + "particle" +}) +@XmlSeeAlso({ + ExplicitGroup.class, + RealGroup.class +}) +public abstract class Group + extends Annotated +{ + + @XmlElementRefs({ + @XmlElementRef(name = "all", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "any", namespace = "http://www.w3.org/2001/XMLSchema", type = Any.class, required = false), + @XmlElementRef(name = "element", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "group", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "choice", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "sequence", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false) + }) + protected List particle; + @XmlAttribute(name = "minOccurs") + @XmlSchemaType(name = "nonNegativeInteger") + protected BigInteger minOccurs; + @XmlAttribute(name = "maxOccurs") + @XmlSchemaType(name = "allNNI") + protected String maxOccurs; + @XmlAttribute(name = "name") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NCName") + protected String name; + @XmlAttribute(name = "ref") + protected QName ref; + + /** + * Gets the value of the particle property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the particle property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getParticle().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link All }{@code >} + * {@link JAXBElement }{@code <}{@link GroupRef }{@code >} + * {@link Any } + * {@link JAXBElement }{@code <}{@link ExplicitGroup }{@code >} + * {@link JAXBElement }{@code <}{@link LocalElement }{@code >} + * {@link JAXBElement }{@code <}{@link ExplicitGroup }{@code >} + * + * + */ + public List getParticle() { + if (particle == null) { + particle = new ArrayList(); + } + return this.particle; + } + + /** + * Gets the value of the minOccurs property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getMinOccurs() { + if (minOccurs == null) { + return new BigInteger("1"); + } else { + return minOccurs; + } + } + + /** + * Sets the value of the minOccurs property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setMinOccurs(BigInteger value) { + this.minOccurs = value; + } + + /** + * Gets the value of the maxOccurs property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMaxOccurs() { + if (maxOccurs == null) { + return "1"; + } else { + return maxOccurs; + } + } + + /** + * Sets the value of the maxOccurs property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMaxOccurs(String value) { + this.maxOccurs = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the ref property. + * + * @return + * possible object is + * {@link QName } + * + */ + public QName getRef() { + return ref; + } + + /** + * Sets the value of the ref property. + * + * @param value + * allowed object is + * {@link QName } + * + */ + public void setRef(QName value) { + this.ref = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/GroupRef.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/GroupRef.java new file mode 100644 index 0000000..528f646 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/GroupRef.java @@ -0,0 +1,44 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for groupRef complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="groupRef">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}realGroup">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "groupRef") +public class GroupRef + extends RealGroup +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Import.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Import.java new file mode 100644 index 0000000..6792566 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Import.java @@ -0,0 +1,100 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <attribute name="namespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *       <attribute name="schemaLocation" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@XmlRootElement(name = "import") +public class Import + extends Annotated +{ + + @XmlAttribute(name = "namespace") + @XmlSchemaType(name = "anyURI") + protected String namespace; + @XmlAttribute(name = "schemaLocation") + @XmlSchemaType(name = "anyURI") + protected String schemaLocation; + + /** + * Gets the value of the namespace property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNamespace() { + return namespace; + } + + /** + * Sets the value of the namespace property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNamespace(String value) { + this.namespace = value; + } + + /** + * Gets the value of the schemaLocation property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSchemaLocation() { + return schemaLocation; + } + + /** + * Sets the value of the schemaLocation property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSchemaLocation(String value) { + this.schemaLocation = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Include.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Include.java new file mode 100644 index 0000000..bc359d4 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Include.java @@ -0,0 +1,72 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <attribute name="schemaLocation" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@XmlRootElement(name = "include") +public class Include + extends Annotated +{ + + @XmlAttribute(name = "schemaLocation", required = true) + @XmlSchemaType(name = "anyURI") + protected String schemaLocation; + + /** + * Gets the value of the schemaLocation property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSchemaLocation() { + return schemaLocation; + } + + /** + * Sets the value of the schemaLocation property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSchemaLocation(String value) { + this.schemaLocation = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Keybase.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Keybase.java new file mode 100644 index 0000000..a3ec2aa --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Keybase.java @@ -0,0 +1,144 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + + +/** + *

Java class for keybase complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="keybase">
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}selector"/>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}field" maxOccurs="unbounded"/>
+ *       </sequence>
+ *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "keybase", propOrder = { + "selector", + "field" +}) +@XmlSeeAlso({ + Keyref.class +}) +public class Keybase + extends Annotated +{ + + @XmlElement(required = true) + protected Selector selector; + @XmlElement(required = true) + protected List field; + @XmlAttribute(name = "name", required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NCName") + protected String name; + + /** + * Gets the value of the selector property. + * + * @return + * possible object is + * {@link Selector } + * + */ + public Selector getSelector() { + return selector; + } + + /** + * Sets the value of the selector property. + * + * @param value + * allowed object is + * {@link Selector } + * + */ + public void setSelector(Selector value) { + this.selector = value; + } + + /** + * Gets the value of the field property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the field property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getField().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Field } + * + * + */ + public List getField() { + if (field == null) { + field = new ArrayList(); + } + return this.field; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Keyref.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Keyref.java new file mode 100644 index 0000000..91c3ad6 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Keyref.java @@ -0,0 +1,71 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}keybase">
+ *       <attribute name="refer" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@XmlRootElement(name = "keyref") +public class Keyref + extends Keybase +{ + + @XmlAttribute(name = "refer", required = true) + protected QName refer; + + /** + * Gets the value of the refer property. + * + * @return + * possible object is + * {@link QName } + * + */ + public QName getRefer() { + return refer; + } + + /** + * Sets the value of the refer property. + * + * @param value + * allowed object is + * {@link QName } + * + */ + public void setRefer(QName value) { + this.refer = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/List.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/List.java new file mode 100644 index 0000000..37161d2 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/List.java @@ -0,0 +1,106 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + + +/** + * + * itemType attribute and simpleType child are mutually + * exclusive, but one or other is required + * + * + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <sequence>
+ *         <element name="simpleType" type="{http://www.w3.org/2001/XMLSchema}localSimpleType" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="itemType" type="{http://www.w3.org/2001/XMLSchema}QName" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "simpleType" +}) +@XmlRootElement(name = "list") +public class List + extends Annotated +{ + + protected LocalSimpleType simpleType; + @XmlAttribute(name = "itemType") + protected QName itemType; + + /** + * Gets the value of the simpleType property. + * + * @return + * possible object is + * {@link LocalSimpleType } + * + */ + public LocalSimpleType getSimpleType() { + return simpleType; + } + + /** + * Sets the value of the simpleType property. + * + * @param value + * allowed object is + * {@link LocalSimpleType } + * + */ + public void setSimpleType(LocalSimpleType value) { + this.simpleType = value; + } + + /** + * Gets the value of the itemType property. + * + * @return + * possible object is + * {@link QName } + * + */ + public QName getItemType() { + return itemType; + } + + /** + * Sets the value of the itemType property. + * + * @param value + * allowed object is + * {@link QName } + * + */ + public void setItemType(QName value) { + this.itemType = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/LocalComplexType.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/LocalComplexType.java new file mode 100644 index 0000000..d45c3d4 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/LocalComplexType.java @@ -0,0 +1,44 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for localComplexType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="localComplexType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}complexType">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *         <group ref="{http://www.w3.org/2001/XMLSchema}complexTypeModel"/>
+ *       </sequence>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "localComplexType") +public class LocalComplexType + extends ComplexType +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/LocalElement.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/LocalElement.java new file mode 100644 index 0000000..067efec --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/LocalElement.java @@ -0,0 +1,52 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for localElement complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="localElement">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}element">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *         <choice minOccurs="0">
+ *           <element name="simpleType" type="{http://www.w3.org/2001/XMLSchema}localSimpleType"/>
+ *           <element name="complexType" type="{http://www.w3.org/2001/XMLSchema}localComplexType"/>
+ *         </choice>
+ *         <group ref="{http://www.w3.org/2001/XMLSchema}identityConstraint" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "localElement") +@XmlSeeAlso({ + NarrowMaxMin.class +}) +public class LocalElement + extends Element +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/LocalSimpleType.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/LocalSimpleType.java new file mode 100644 index 0000000..828cbdf --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/LocalSimpleType.java @@ -0,0 +1,44 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for localSimpleType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="localSimpleType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}simpleType">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *         <group ref="{http://www.w3.org/2001/XMLSchema}simpleDerivation"/>
+ *       </sequence>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "localSimpleType") +public class LocalSimpleType + extends SimpleType +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/NamedAttributeGroup.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/NamedAttributeGroup.java new file mode 100644 index 0000000..5789786 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/NamedAttributeGroup.java @@ -0,0 +1,45 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for namedAttributeGroup complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="namedAttributeGroup">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}attributeGroup">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *         <group ref="{http://www.w3.org/2001/XMLSchema}attrDecls"/>
+ *       </sequence>
+ *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "namedAttributeGroup") +public class NamedAttributeGroup + extends AttributeGroup +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/NamedGroup.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/NamedGroup.java new file mode 100644 index 0000000..5aee992 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/NamedGroup.java @@ -0,0 +1,58 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for namedGroup complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="namedGroup">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}realGroup">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *         <choice>
+ *           <element name="all">
+ *             <complexType>
+ *               <complexContent>
+ *                 <restriction base="{http://www.w3.org/2001/XMLSchema}all">
+ *                   <group ref="{http://www.w3.org/2001/XMLSchema}allModel"/>
+ *                   <anyAttribute processContents='lax' namespace='##other'/>
+ *                 </restriction>
+ *               </complexContent>
+ *             </complexType>
+ *           </element>
+ *           <element name="choice" type="{http://www.w3.org/2001/XMLSchema}simpleExplicitGroup"/>
+ *           <element name="sequence" type="{http://www.w3.org/2001/XMLSchema}simpleExplicitGroup"/>
+ *         </choice>
+ *       </sequence>
+ *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "namedGroup") +public class NamedGroup + extends RealGroup +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/NarrowMaxMin.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/NarrowMaxMin.java new file mode 100644 index 0000000..8c026af --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/NarrowMaxMin.java @@ -0,0 +1,66 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + * restricted max/min + * + *

Java class for narrowMaxMin complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="narrowMaxMin">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}localElement">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *         <choice minOccurs="0">
+ *           <element name="simpleType" type="{http://www.w3.org/2001/XMLSchema}localSimpleType"/>
+ *           <element name="complexType" type="{http://www.w3.org/2001/XMLSchema}localComplexType"/>
+ *         </choice>
+ *         <group ref="{http://www.w3.org/2001/XMLSchema}identityConstraint" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="minOccurs" default="1">
+ *         <simpleType>
+ *           <restriction base="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger">
+ *             <enumeration value="0"/>
+ *             <enumeration value="1"/>
+ *           </restriction>
+ *         </simpleType>
+ *       </attribute>
+ *       <attribute name="maxOccurs" default="1">
+ *         <simpleType>
+ *           <restriction base="{http://www.w3.org/2001/XMLSchema}allNNI">
+ *             <enumeration value="0"/>
+ *             <enumeration value="1"/>
+ *           </restriction>
+ *         </simpleType>
+ *       </attribute>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "narrowMaxMin") +public class NarrowMaxMin + extends LocalElement +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/NoFixedFacet.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/NoFixedFacet.java new file mode 100644 index 0000000..466006e --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/NoFixedFacet.java @@ -0,0 +1,47 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for noFixedFacet complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="noFixedFacet">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}facet">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *       </sequence>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "noFixedFacet") +@XmlSeeAlso({ + Pattern.class +}) +public class NoFixedFacet + extends Facet +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Notation.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Notation.java new file mode 100644 index 0000000..a1db2ee --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Notation.java @@ -0,0 +1,132 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
+ *       <attribute name="public" type="{http://www.w3.org/2001/XMLSchema}public" />
+ *       <attribute name="system" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@XmlRootElement(name = "notation") +public class Notation + extends Annotated +{ + + @XmlAttribute(name = "name", required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NCName") + protected String name; + @XmlAttribute(name = "public") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "public") + protected String _public; + @XmlAttribute(name = "system") + @XmlSchemaType(name = "anyURI") + protected String system; + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the public property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPublic() { + return _public; + } + + /** + * Sets the value of the public property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPublic(String value) { + this._public = value; + } + + /** + * Gets the value of the system property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSystem() { + return system; + } + + /** + * Sets the value of the system property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSystem(String value) { + this.system = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/NumFacet.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/NumFacet.java new file mode 100644 index 0000000..6fe5cfa --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/NumFacet.java @@ -0,0 +1,48 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for numFacet complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="numFacet">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}facet">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "numFacet") +@XmlSeeAlso({ + TotalDigits.class +}) +public class NumFacet + extends Facet +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ObjectFactory.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ObjectFactory.java new file mode 100644 index 0000000..90c1f32 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ObjectFactory.java @@ -0,0 +1,662 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the org.w3._2001.xmlschema package. + *

An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _MinInclusive_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "minInclusive"); + private final static QName _MaxLength_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "maxLength"); + private final static QName _Sequence_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "sequence"); + private final static QName _MinLength_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "minLength"); + private final static QName _Group_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "group"); + private final static QName _AttributeGroup_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "attributeGroup"); + private final static QName _Key_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "key"); + private final static QName _All_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "all"); + private final static QName _Length_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "length"); + private final static QName _SimpleType_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "simpleType"); + private final static QName _Enumeration_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "enumeration"); + private final static QName _Choice_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "choice"); + private final static QName _FractionDigits_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "fractionDigits"); + private final static QName _MinExclusive_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "minExclusive"); + private final static QName _MaxExclusive_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "maxExclusive"); + private final static QName _Element_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "element"); + private final static QName _Unique_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "unique"); + private final static QName _ComplexType_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "complexType"); + private final static QName _MaxInclusive_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "maxInclusive"); + private final static QName _Attribute_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "attribute"); + private final static QName _AnyAttribute_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "anyAttribute"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.w3._2001.xmlschema + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link Selector } + * + */ + public Selector createSelector() { + return new Selector(); + } + + /** + * Create an instance of {@link Annotated } + * + */ + public Annotated createAnnotated() { + return new Annotated(); + } + + /** + * Create an instance of {@link OpenAttrs } + * + */ + public OpenAttrs createOpenAttrs() { + return new OpenAttrs(); + } + + /** + * Create an instance of {@link Annotation } + * + */ + public Annotation createAnnotation() { + return new Annotation(); + } + + /** + * Create an instance of {@link Appinfo } + * + */ + public Appinfo createAppinfo() { + return new Appinfo(); + } + + /** + * Create an instance of {@link Documentation } + * + */ + public Documentation createDocumentation() { + return new Documentation(); + } + + /** + * Create an instance of {@link Facet } + * + */ + public Facet createFacet() { + return new Facet(); + } + + /** + * Create an instance of {@link TopLevelComplexType } + * + */ + public TopLevelComplexType createTopLevelComplexType() { + return new TopLevelComplexType(); + } + + /** + * Create an instance of {@link Keybase } + * + */ + public Keybase createKeybase() { + return new Keybase(); + } + + /** + * Create an instance of {@link NumFacet } + * + */ + public NumFacet createNumFacet() { + return new NumFacet(); + } + + /** + * Create an instance of {@link ExplicitGroup } + * + */ + public ExplicitGroup createExplicitGroup() { + return new ExplicitGroup(); + } + + /** + * Create an instance of {@link ComplexContent } + * + */ + public ComplexContent createComplexContent() { + return new ComplexContent(); + } + + /** + * Create an instance of {@link ComplexRestrictionType } + * + */ + public ComplexRestrictionType createComplexRestrictionType() { + return new ComplexRestrictionType(); + } + + /** + * Create an instance of {@link ExtensionType } + * + */ + public ExtensionType createExtensionType() { + return new ExtensionType(); + } + + /** + * Create an instance of {@link TopLevelAttribute } + * + */ + public TopLevelAttribute createTopLevelAttribute() { + return new TopLevelAttribute(); + } + + /** + * Create an instance of {@link Keyref } + * + */ + public Keyref createKeyref() { + return new Keyref(); + } + + /** + * Create an instance of {@link Field } + * + */ + public Field createField() { + return new Field(); + } + + /** + * Create an instance of {@link Wildcard } + * + */ + public Wildcard createWildcard() { + return new Wildcard(); + } + + /** + * Create an instance of {@link Schema } + * + */ + public Schema createSchema() { + return new Schema(); + } + + /** + * Create an instance of {@link Include } + * + */ + public Include createInclude() { + return new Include(); + } + + /** + * Create an instance of {@link Import } + * + */ + public Import createImport() { + return new Import(); + } + + /** + * Create an instance of {@link Redefine } + * + */ + public Redefine createRedefine() { + return new Redefine(); + } + + /** + * Create an instance of {@link TopLevelSimpleType } + * + */ + public TopLevelSimpleType createTopLevelSimpleType() { + return new TopLevelSimpleType(); + } + + /** + * Create an instance of {@link NamedGroup } + * + */ + public NamedGroup createNamedGroup() { + return new NamedGroup(); + } + + /** + * Create an instance of {@link NamedAttributeGroup } + * + */ + public NamedAttributeGroup createNamedAttributeGroup() { + return new NamedAttributeGroup(); + } + + /** + * Create an instance of {@link TopLevelElement } + * + */ + public TopLevelElement createTopLevelElement() { + return new TopLevelElement(); + } + + /** + * Create an instance of {@link Notation } + * + */ + public Notation createNotation() { + return new Notation(); + } + + /** + * Create an instance of {@link Union } + * + */ + public Union createUnion() { + return new Union(); + } + + /** + * Create an instance of {@link LocalSimpleType } + * + */ + public LocalSimpleType createLocalSimpleType() { + return new LocalSimpleType(); + } + + /** + * Create an instance of {@link Any } + * + */ + public Any createAny() { + return new Any(); + } + + /** + * Create an instance of {@link All } + * + */ + public All createAll() { + return new All(); + } + + /** + * Create an instance of {@link WhiteSpace } + * + */ + public WhiteSpace createWhiteSpace() { + return new WhiteSpace(); + } + + /** + * Create an instance of {@link TotalDigits } + * + */ + public TotalDigits createTotalDigits() { + return new TotalDigits(); + } + + /** + * Create an instance of {@link Restriction } + * + */ + public Restriction createRestriction() { + return new Restriction(); + } + + /** + * Create an instance of {@link NoFixedFacet } + * + */ + public NoFixedFacet createNoFixedFacet() { + return new NoFixedFacet(); + } + + /** + * Create an instance of {@link Pattern } + * + */ + public Pattern createPattern() { + return new Pattern(); + } + + /** + * Create an instance of {@link List } + * + */ + public List createList() { + return new List(); + } + + /** + * Create an instance of {@link SimpleContent } + * + */ + public SimpleContent createSimpleContent() { + return new SimpleContent(); + } + + /** + * Create an instance of {@link SimpleRestrictionType } + * + */ + public SimpleRestrictionType createSimpleRestrictionType() { + return new SimpleRestrictionType(); + } + + /** + * Create an instance of {@link SimpleExtensionType } + * + */ + public SimpleExtensionType createSimpleExtensionType() { + return new SimpleExtensionType(); + } + + /** + * Create an instance of {@link NarrowMaxMin } + * + */ + public NarrowMaxMin createNarrowMaxMin() { + return new NarrowMaxMin(); + } + + /** + * Create an instance of {@link LocalElement } + * + */ + public LocalElement createLocalElement() { + return new LocalElement(); + } + + /** + * Create an instance of {@link LocalComplexType } + * + */ + public LocalComplexType createLocalComplexType() { + return new LocalComplexType(); + } + + /** + * Create an instance of {@link SimpleExplicitGroup } + * + */ + public SimpleExplicitGroup createSimpleExplicitGroup() { + return new SimpleExplicitGroup(); + } + + /** + * Create an instance of {@link AttributeGroupRef } + * + */ + public AttributeGroupRef createAttributeGroupRef() { + return new AttributeGroupRef(); + } + + /** + * Create an instance of {@link GroupRef } + * + */ + public GroupRef createGroupRef() { + return new GroupRef(); + } + + /** + * Create an instance of {@link Attribute } + * + */ + public Attribute createAttribute() { + return new Attribute(); + } + + /** + * Create an instance of {@link RealGroup } + * + */ + public RealGroup createRealGroup() { + return new RealGroup(); + } + + /** + * Create an instance of {@link RestrictionType } + * + */ + public RestrictionType createRestrictionType() { + return new RestrictionType(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Facet }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "minInclusive") + public JAXBElement createMinInclusive(Facet value) { + return new JAXBElement(_MinInclusive_QNAME, Facet.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link NumFacet }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "maxLength") + public JAXBElement createMaxLength(NumFacet value) { + return new JAXBElement(_MaxLength_QNAME, NumFacet.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ExplicitGroup }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "sequence") + public JAXBElement createSequence(ExplicitGroup value) { + return new JAXBElement(_Sequence_QNAME, ExplicitGroup.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link NumFacet }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "minLength") + public JAXBElement createMinLength(NumFacet value) { + return new JAXBElement(_MinLength_QNAME, NumFacet.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link NamedGroup }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "group") + public JAXBElement createGroup(NamedGroup value) { + return new JAXBElement(_Group_QNAME, NamedGroup.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link NamedAttributeGroup }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "attributeGroup") + public JAXBElement createAttributeGroup(NamedAttributeGroup value) { + return new JAXBElement(_AttributeGroup_QNAME, NamedAttributeGroup.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Keybase }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "key") + public JAXBElement createKey(Keybase value) { + return new JAXBElement(_Key_QNAME, Keybase.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link All }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "all") + public JAXBElement createAll(All value) { + return new JAXBElement(_All_QNAME, All.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link NumFacet }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "length") + public JAXBElement createLength(NumFacet value) { + return new JAXBElement(_Length_QNAME, NumFacet.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TopLevelSimpleType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "simpleType") + public JAXBElement createSimpleType(TopLevelSimpleType value) { + return new JAXBElement(_SimpleType_QNAME, TopLevelSimpleType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link NoFixedFacet }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "enumeration") + public JAXBElement createEnumeration(NoFixedFacet value) { + return new JAXBElement(_Enumeration_QNAME, NoFixedFacet.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ExplicitGroup }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "choice") + public JAXBElement createChoice(ExplicitGroup value) { + return new JAXBElement(_Choice_QNAME, ExplicitGroup.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link NumFacet }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "fractionDigits") + public JAXBElement createFractionDigits(NumFacet value) { + return new JAXBElement(_FractionDigits_QNAME, NumFacet.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Facet }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "minExclusive") + public JAXBElement createMinExclusive(Facet value) { + return new JAXBElement(_MinExclusive_QNAME, Facet.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Facet }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "maxExclusive") + public JAXBElement createMaxExclusive(Facet value) { + return new JAXBElement(_MaxExclusive_QNAME, Facet.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TopLevelElement }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "element") + public JAXBElement createElement(TopLevelElement value) { + return new JAXBElement(_Element_QNAME, TopLevelElement.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Keybase }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "unique") + public JAXBElement createUnique(Keybase value) { + return new JAXBElement(_Unique_QNAME, Keybase.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TopLevelComplexType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "complexType") + public JAXBElement createComplexType(TopLevelComplexType value) { + return new JAXBElement(_ComplexType_QNAME, TopLevelComplexType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Facet }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "maxInclusive") + public JAXBElement createMaxInclusive(Facet value) { + return new JAXBElement(_MaxInclusive_QNAME, Facet.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TopLevelAttribute }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "attribute") + public JAXBElement createAttribute(TopLevelAttribute value) { + return new JAXBElement(_Attribute_QNAME, TopLevelAttribute.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Wildcard }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "anyAttribute") + public JAXBElement createAnyAttribute(Wildcard value) { + return new JAXBElement(_AnyAttribute_QNAME, Wildcard.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link LocalElement }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "element", scope = Group.class) + public JAXBElement createGroupElement(LocalElement value) { + return new JAXBElement(_Element_QNAME, LocalElement.class, Group.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GroupRef }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2001/XMLSchema", name = "group", scope = Group.class) + public JAXBElement createGroupGroup(GroupRef value) { + return new JAXBElement(_Group_QNAME, GroupRef.class, Group.class, value); + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/OpenAttrs.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/OpenAttrs.java new file mode 100644 index 0000000..96f68f5 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/OpenAttrs.java @@ -0,0 +1,75 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import java.util.HashMap; +import java.util.Map; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + + +/** + * + * This type is extended by almost all schema types + * to allow attributes from other namespaces to be + * added to user schemas. + * + * + *

Java class for openAttrs complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="openAttrs">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "openAttrs") +@XmlSeeAlso({ + Redefine.class, + Schema.class, + Annotation.class, + Annotated.class +}) +public class OpenAttrs { + + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Pattern.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Pattern.java new file mode 100644 index 0000000..303fb58 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Pattern.java @@ -0,0 +1,46 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}noFixedFacet">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@XmlRootElement(name = "pattern") +public class Pattern + extends NoFixedFacet +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/RealGroup.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/RealGroup.java new file mode 100644 index 0000000..4eb409e --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/RealGroup.java @@ -0,0 +1,53 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for realGroup complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="realGroup">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}group">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *         <choice minOccurs="0">
+ *           <element ref="{http://www.w3.org/2001/XMLSchema}all"/>
+ *           <element ref="{http://www.w3.org/2001/XMLSchema}choice"/>
+ *           <element ref="{http://www.w3.org/2001/XMLSchema}sequence"/>
+ *         </choice>
+ *       </sequence>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "realGroup") +@XmlSeeAlso({ + NamedGroup.class, + GroupRef.class +}) +public class RealGroup + extends Group +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Redefine.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Redefine.java new file mode 100644 index 0000000..0274c50 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Redefine.java @@ -0,0 +1,156 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElements; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}openAttrs">
+ *       <choice maxOccurs="unbounded" minOccurs="0">
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation"/>
+ *         <group ref="{http://www.w3.org/2001/XMLSchema}redefinable"/>
+ *       </choice>
+ *       <attribute name="schemaLocation" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "annotationOrSimpleTypeOrComplexType" +}) +@XmlRootElement(name = "redefine") +public class Redefine + extends OpenAttrs +{ + + @XmlElements({ + @XmlElement(name = "annotation", type = Annotation.class), + @XmlElement(name = "simpleType", type = TopLevelSimpleType.class), + @XmlElement(name = "complexType", type = TopLevelComplexType.class), + @XmlElement(name = "group", type = NamedGroup.class), + @XmlElement(name = "attributeGroup", type = NamedAttributeGroup.class) + }) + protected List annotationOrSimpleTypeOrComplexType; + @XmlAttribute(name = "schemaLocation", required = true) + @XmlSchemaType(name = "anyURI") + protected String schemaLocation; + @XmlAttribute(name = "id") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + + /** + * Gets the value of the annotationOrSimpleTypeOrComplexType property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the annotationOrSimpleTypeOrComplexType property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getAnnotationOrSimpleTypeOrComplexType().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Annotation } + * {@link TopLevelSimpleType } + * {@link TopLevelComplexType } + * {@link NamedGroup } + * {@link NamedAttributeGroup } + * + * + */ + public List getAnnotationOrSimpleTypeOrComplexType() { + if (annotationOrSimpleTypeOrComplexType == null) { + annotationOrSimpleTypeOrComplexType = new ArrayList(); + } + return this.annotationOrSimpleTypeOrComplexType; + } + + /** + * Gets the value of the schemaLocation property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSchemaLocation() { + return schemaLocation; + } + + /** + * Sets the value of the schemaLocation property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSchemaLocation(String value) { + this.schemaLocation = value; + } + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ReducedDerivationControl.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ReducedDerivationControl.java new file mode 100644 index 0000000..a427071 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/ReducedDerivationControl.java @@ -0,0 +1,58 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for reducedDerivationControl. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="reducedDerivationControl">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}derivationControl">
+ *     <enumeration value="extension"/>
+ *     <enumeration value="restriction"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "reducedDerivationControl") +@XmlEnum(DerivationControl.class) +public enum ReducedDerivationControl { + + @XmlEnumValue("extension") + EXTENSION(DerivationControl.EXTENSION), + @XmlEnumValue("restriction") + RESTRICTION(DerivationControl.RESTRICTION); + private final DerivationControl value; + + ReducedDerivationControl(DerivationControl v) { + value = v; + } + + public DerivationControl value() { + return value; + } + + public static ReducedDerivationControl fromValue(DerivationControl v) { + for (ReducedDerivationControl c: ReducedDerivationControl.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v.toString()); + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Restriction.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Restriction.java new file mode 100644 index 0000000..0e1d6bf --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Restriction.java @@ -0,0 +1,165 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + + +/** + * + * base attribute and simpleType child are mutually + * exclusive, but one or other is required + * + * + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <group ref="{http://www.w3.org/2001/XMLSchema}simpleRestrictionModel"/>
+ *       <attribute name="base" type="{http://www.w3.org/2001/XMLSchema}QName" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "simpleType", + "facets" +}) +@XmlRootElement(name = "restriction") +public class Restriction + extends Annotated +{ + + protected LocalSimpleType simpleType; + @XmlElementRefs({ + @XmlElementRef(name = "enumeration", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "fractionDigits", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "totalDigits", namespace = "http://www.w3.org/2001/XMLSchema", type = TotalDigits.class, required = false), + @XmlElementRef(name = "minInclusive", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "pattern", namespace = "http://www.w3.org/2001/XMLSchema", type = Pattern.class, required = false), + @XmlElementRef(name = "whiteSpace", namespace = "http://www.w3.org/2001/XMLSchema", type = WhiteSpace.class, required = false), + @XmlElementRef(name = "minLength", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "maxLength", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "maxInclusive", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "length", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "maxExclusive", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "minExclusive", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false) + }) + protected List facets; + @XmlAttribute(name = "base") + protected QName base; + + /** + * Gets the value of the simpleType property. + * + * @return + * possible object is + * {@link LocalSimpleType } + * + */ + public LocalSimpleType getSimpleType() { + return simpleType; + } + + /** + * Sets the value of the simpleType property. + * + * @param value + * allowed object is + * {@link LocalSimpleType } + * + */ + public void setSimpleType(LocalSimpleType value) { + this.simpleType = value; + } + + /** + * Gets the value of the facets property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the facets property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getFacets().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link NumFacet }{@code >} + * {@link JAXBElement }{@code <}{@link NoFixedFacet }{@code >} + * {@link TotalDigits } + * {@link JAXBElement }{@code <}{@link Facet }{@code >} + * {@link JAXBElement }{@code <}{@link NumFacet }{@code >} + * {@link WhiteSpace } + * {@link Pattern } + * {@link JAXBElement }{@code <}{@link NumFacet }{@code >} + * {@link JAXBElement }{@code <}{@link Facet }{@code >} + * {@link JAXBElement }{@code <}{@link Facet }{@code >} + * {@link JAXBElement }{@code <}{@link NumFacet }{@code >} + * {@link JAXBElement }{@code <}{@link Facet }{@code >} + * + * + */ + public List getFacets() { + if (facets == null) { + facets = new ArrayList(); + } + return this.facets; + } + + /** + * Gets the value of the base property. + * + * @return + * possible object is + * {@link QName } + * + */ + public QName getBase() { + return base; + } + + /** + * Sets the value of the base property. + * + * @param value + * allowed object is + * {@link QName } + * + */ + public void setBase(QName value) { + this.base = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/RestrictionType.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/RestrictionType.java new file mode 100644 index 0000000..6087e4e --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/RestrictionType.java @@ -0,0 +1,337 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; +import javax.xml.bind.annotation.XmlElements; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + + +/** + *

Java class for restrictionType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="restrictionType">
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <sequence>
+ *         <choice minOccurs="0">
+ *           <group ref="{http://www.w3.org/2001/XMLSchema}typeDefParticle"/>
+ *           <group ref="{http://www.w3.org/2001/XMLSchema}simpleRestrictionModel"/>
+ *         </choice>
+ *         <group ref="{http://www.w3.org/2001/XMLSchema}attrDecls"/>
+ *       </sequence>
+ *       <attribute name="base" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "restrictionType", propOrder = { + "group", + "all", + "choice", + "sequence", + "simpleType", + "facets", + "attributeOrAttributeGroup", + "anyAttribute" +}) +@XmlSeeAlso({ + ComplexRestrictionType.class, + SimpleRestrictionType.class +}) +public class RestrictionType + extends Annotated +{ + + protected GroupRef group; + protected All all; + protected ExplicitGroup choice; + protected ExplicitGroup sequence; + protected LocalSimpleType simpleType; + @XmlElementRefs({ + @XmlElementRef(name = "enumeration", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "fractionDigits", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "totalDigits", namespace = "http://www.w3.org/2001/XMLSchema", type = TotalDigits.class, required = false), + @XmlElementRef(name = "minInclusive", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "pattern", namespace = "http://www.w3.org/2001/XMLSchema", type = Pattern.class, required = false), + @XmlElementRef(name = "whiteSpace", namespace = "http://www.w3.org/2001/XMLSchema", type = WhiteSpace.class, required = false), + @XmlElementRef(name = "minLength", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "maxLength", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "maxInclusive", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "length", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "maxExclusive", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false), + @XmlElementRef(name = "minExclusive", namespace = "http://www.w3.org/2001/XMLSchema", type = JAXBElement.class, required = false) + }) + protected List facets; + @XmlElements({ + @XmlElement(name = "attribute", type = Attribute.class), + @XmlElement(name = "attributeGroup", type = AttributeGroupRef.class) + }) + protected List attributeOrAttributeGroup; + protected Wildcard anyAttribute; + @XmlAttribute(name = "base", required = true) + protected QName base; + + /** + * Gets the value of the group property. + * + * @return + * possible object is + * {@link GroupRef } + * + */ + public GroupRef getGroup() { + return group; + } + + /** + * Sets the value of the group property. + * + * @param value + * allowed object is + * {@link GroupRef } + * + */ + public void setGroup(GroupRef value) { + this.group = value; + } + + /** + * Gets the value of the all property. + * + * @return + * possible object is + * {@link All } + * + */ + public All getAll() { + return all; + } + + /** + * Sets the value of the all property. + * + * @param value + * allowed object is + * {@link All } + * + */ + public void setAll(All value) { + this.all = value; + } + + /** + * Gets the value of the choice property. + * + * @return + * possible object is + * {@link ExplicitGroup } + * + */ + public ExplicitGroup getChoice() { + return choice; + } + + /** + * Sets the value of the choice property. + * + * @param value + * allowed object is + * {@link ExplicitGroup } + * + */ + public void setChoice(ExplicitGroup value) { + this.choice = value; + } + + /** + * Gets the value of the sequence property. + * + * @return + * possible object is + * {@link ExplicitGroup } + * + */ + public ExplicitGroup getSequence() { + return sequence; + } + + /** + * Sets the value of the sequence property. + * + * @param value + * allowed object is + * {@link ExplicitGroup } + * + */ + public void setSequence(ExplicitGroup value) { + this.sequence = value; + } + + /** + * Gets the value of the simpleType property. + * + * @return + * possible object is + * {@link LocalSimpleType } + * + */ + public LocalSimpleType getSimpleType() { + return simpleType; + } + + /** + * Sets the value of the simpleType property. + * + * @param value + * allowed object is + * {@link LocalSimpleType } + * + */ + public void setSimpleType(LocalSimpleType value) { + this.simpleType = value; + } + + /** + * Gets the value of the facets property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the facets property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getFacets().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link NumFacet }{@code >} + * {@link JAXBElement }{@code <}{@link NoFixedFacet }{@code >} + * {@link TotalDigits } + * {@link JAXBElement }{@code <}{@link Facet }{@code >} + * {@link JAXBElement }{@code <}{@link NumFacet }{@code >} + * {@link WhiteSpace } + * {@link Pattern } + * {@link JAXBElement }{@code <}{@link NumFacet }{@code >} + * {@link JAXBElement }{@code <}{@link Facet }{@code >} + * {@link JAXBElement }{@code <}{@link Facet }{@code >} + * {@link JAXBElement }{@code <}{@link NumFacet }{@code >} + * {@link JAXBElement }{@code <}{@link Facet }{@code >} + * + * + */ + public List getFacets() { + if (facets == null) { + facets = new ArrayList(); + } + return this.facets; + } + + /** + * Gets the value of the attributeOrAttributeGroup property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the attributeOrAttributeGroup property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getAttributeOrAttributeGroup().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Attribute } + * {@link AttributeGroupRef } + * + * + */ + public List getAttributeOrAttributeGroup() { + if (attributeOrAttributeGroup == null) { + attributeOrAttributeGroup = new ArrayList(); + } + return this.attributeOrAttributeGroup; + } + + /** + * Gets the value of the anyAttribute property. + * + * @return + * possible object is + * {@link Wildcard } + * + */ + public Wildcard getAnyAttribute() { + return anyAttribute; + } + + /** + * Sets the value of the anyAttribute property. + * + * @param value + * allowed object is + * {@link Wildcard } + * + */ + public void setAnyAttribute(Wildcard value) { + this.anyAttribute = value; + } + + /** + * Gets the value of the base property. + * + * @return + * possible object is + * {@link QName } + * + */ + public QName getBase() { + return base; + } + + /** + * Sets the value of the base property. + * + * @param value + * allowed object is + * {@link QName } + * + */ + public void setBase(QName value) { + this.base = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Schema.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Schema.java new file mode 100644 index 0000000..afb77d9 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Schema.java @@ -0,0 +1,394 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElements; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}openAttrs">
+ *       <sequence>
+ *         <choice maxOccurs="unbounded" minOccurs="0">
+ *           <element ref="{http://www.w3.org/2001/XMLSchema}include"/>
+ *           <element ref="{http://www.w3.org/2001/XMLSchema}import"/>
+ *           <element ref="{http://www.w3.org/2001/XMLSchema}redefine"/>
+ *           <element ref="{http://www.w3.org/2001/XMLSchema}annotation"/>
+ *         </choice>
+ *         <sequence maxOccurs="unbounded" minOccurs="0">
+ *           <group ref="{http://www.w3.org/2001/XMLSchema}schemaTop"/>
+ *           <element ref="{http://www.w3.org/2001/XMLSchema}annotation" maxOccurs="unbounded" minOccurs="0"/>
+ *         </sequence>
+ *       </sequence>
+ *       <attribute name="targetNamespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *       <attribute name="version" type="{http://www.w3.org/2001/XMLSchema}token" />
+ *       <attribute name="finalDefault" type="{http://www.w3.org/2001/XMLSchema}fullDerivationSet" default="" />
+ *       <attribute name="blockDefault" type="{http://www.w3.org/2001/XMLSchema}blockSet" default="" />
+ *       <attribute name="attributeFormDefault" type="{http://www.w3.org/2001/XMLSchema}formChoice" default="unqualified" />
+ *       <attribute name="elementFormDefault" type="{http://www.w3.org/2001/XMLSchema}formChoice" default="unqualified" />
+ *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *       <attribute ref="{http://www.w3.org/XML/1998/namespace}lang"/>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "includeOrImportOrRedefine", + "simpleTypeOrComplexTypeOrGroup" +}) +@XmlRootElement(name = "schema") +public class Schema + extends OpenAttrs +{ + + @XmlElements({ + @XmlElement(name = "include", type = Include.class), + @XmlElement(name = "import", type = Import.class), + @XmlElement(name = "redefine", type = Redefine.class), + @XmlElement(name = "annotation", type = Annotation.class) + }) + protected List includeOrImportOrRedefine; + @XmlElements({ + @XmlElement(name = "simpleType", type = TopLevelSimpleType.class), + @XmlElement(name = "complexType", type = TopLevelComplexType.class), + @XmlElement(name = "group", type = NamedGroup.class), + @XmlElement(name = "attributeGroup", type = NamedAttributeGroup.class), + @XmlElement(name = "element", type = TopLevelElement.class), + @XmlElement(name = "attribute", type = TopLevelAttribute.class), + @XmlElement(name = "notation", type = Notation.class), + @XmlElement(name = "annotation", type = Annotation.class) + }) + protected List simpleTypeOrComplexTypeOrGroup; + @XmlAttribute(name = "targetNamespace") + @XmlSchemaType(name = "anyURI") + protected String targetNamespace; + @XmlAttribute(name = "version") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "token") + protected String version; + @XmlAttribute(name = "finalDefault") + @XmlSchemaType(name = "fullDerivationSet") + protected List finalDefault; + @XmlAttribute(name = "blockDefault") + @XmlSchemaType(name = "blockSet") + protected List blockDefault; + @XmlAttribute(name = "attributeFormDefault") + protected FormChoice attributeFormDefault; + @XmlAttribute(name = "elementFormDefault") + protected FormChoice elementFormDefault; + @XmlAttribute(name = "id") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + @XmlAttribute(name = "lang", namespace = "http://www.w3.org/XML/1998/namespace") + protected String lang; + + /** + * Gets the value of the includeOrImportOrRedefine property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the includeOrImportOrRedefine property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getIncludeOrImportOrRedefine().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Include } + * {@link Import } + * {@link Redefine } + * {@link Annotation } + * + * + */ + public List getIncludeOrImportOrRedefine() { + if (includeOrImportOrRedefine == null) { + includeOrImportOrRedefine = new ArrayList(); + } + return this.includeOrImportOrRedefine; + } + + /** + * Gets the value of the simpleTypeOrComplexTypeOrGroup property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the simpleTypeOrComplexTypeOrGroup property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getSimpleTypeOrComplexTypeOrGroup().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link TopLevelSimpleType } + * {@link TopLevelComplexType } + * {@link NamedGroup } + * {@link NamedAttributeGroup } + * {@link TopLevelElement } + * {@link TopLevelAttribute } + * {@link Notation } + * {@link Annotation } + * + * + */ + public List getSimpleTypeOrComplexTypeOrGroup() { + if (simpleTypeOrComplexTypeOrGroup == null) { + simpleTypeOrComplexTypeOrGroup = new ArrayList(); + } + return this.simpleTypeOrComplexTypeOrGroup; + } + + /** + * Gets the value of the targetNamespace property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTargetNamespace() { + return targetNamespace; + } + + /** + * Sets the value of the targetNamespace property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTargetNamespace(String value) { + this.targetNamespace = value; + } + + /** + * Gets the value of the version property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getVersion() { + return version; + } + + /** + * Sets the value of the version property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setVersion(String value) { + this.version = value; + } + + /** + * Gets the value of the finalDefault property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the finalDefault property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getFinalDefault().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getFinalDefault() { + if (finalDefault == null) { + finalDefault = new ArrayList(); + } + return this.finalDefault; + } + + /** + * Gets the value of the blockDefault property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the blockDefault property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getBlockDefault().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getBlockDefault() { + if (blockDefault == null) { + blockDefault = new ArrayList(); + } + return this.blockDefault; + } + + /** + * Gets the value of the attributeFormDefault property. + * + * @return + * possible object is + * {@link FormChoice } + * + */ + public FormChoice getAttributeFormDefault() { + if (attributeFormDefault == null) { + return FormChoice.UNQUALIFIED; + } else { + return attributeFormDefault; + } + } + + /** + * Sets the value of the attributeFormDefault property. + * + * @param value + * allowed object is + * {@link FormChoice } + * + */ + public void setAttributeFormDefault(FormChoice value) { + this.attributeFormDefault = value; + } + + /** + * Gets the value of the elementFormDefault property. + * + * @return + * possible object is + * {@link FormChoice } + * + */ + public FormChoice getElementFormDefault() { + if (elementFormDefault == null) { + return FormChoice.UNQUALIFIED; + } else { + return elementFormDefault; + } + } + + /** + * Sets the value of the elementFormDefault property. + * + * @param value + * allowed object is + * {@link FormChoice } + * + */ + public void setElementFormDefault(FormChoice value) { + this.elementFormDefault = value; + } + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the lang property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLang() { + return lang; + } + + /** + * Sets the value of the lang property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLang(String value) { + this.lang = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Selector.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Selector.java new file mode 100644 index 0000000..7ba6752 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Selector.java @@ -0,0 +1,79 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <attribute name="xpath" use="required">
+ *         <simpleType>
+ *           <restriction base="{http://www.w3.org/2001/XMLSchema}token">
+ *             <pattern value="(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*(\|(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*)*"/>
+ *           </restriction>
+ *         </simpleType>
+ *       </attribute>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@XmlRootElement(name = "selector") +public class Selector + extends Annotated +{ + + @XmlAttribute(name = "xpath", required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + protected String xpath; + + /** + * Gets the value of the xpath property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getXpath() { + return xpath; + } + + /** + * Sets the value of the xpath property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setXpath(String value) { + this.xpath = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/SimpleContent.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/SimpleContent.java new file mode 100644 index 0000000..43a94bd --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/SimpleContent.java @@ -0,0 +1,99 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <choice>
+ *         <element name="restriction" type="{http://www.w3.org/2001/XMLSchema}simpleRestrictionType"/>
+ *         <element name="extension" type="{http://www.w3.org/2001/XMLSchema}simpleExtensionType"/>
+ *       </choice>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "restriction", + "extension" +}) +@XmlRootElement(name = "simpleContent") +public class SimpleContent + extends Annotated +{ + + protected SimpleRestrictionType restriction; + protected SimpleExtensionType extension; + + /** + * Gets the value of the restriction property. + * + * @return + * possible object is + * {@link SimpleRestrictionType } + * + */ + public SimpleRestrictionType getRestriction() { + return restriction; + } + + /** + * Sets the value of the restriction property. + * + * @param value + * allowed object is + * {@link SimpleRestrictionType } + * + */ + public void setRestriction(SimpleRestrictionType value) { + this.restriction = value; + } + + /** + * Gets the value of the extension property. + * + * @return + * possible object is + * {@link SimpleExtensionType } + * + */ + public SimpleExtensionType getExtension() { + return extension; + } + + /** + * Sets the value of the extension property. + * + * @param value + * allowed object is + * {@link SimpleExtensionType } + * + */ + public void setExtension(SimpleExtensionType value) { + this.extension = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/SimpleExplicitGroup.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/SimpleExplicitGroup.java new file mode 100644 index 0000000..0896ace --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/SimpleExplicitGroup.java @@ -0,0 +1,44 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for simpleExplicitGroup complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="simpleExplicitGroup">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}explicitGroup">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *         <group ref="{http://www.w3.org/2001/XMLSchema}nestedParticle" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "simpleExplicitGroup") +public class SimpleExplicitGroup + extends ExplicitGroup +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/SimpleExtensionType.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/SimpleExtensionType.java new file mode 100644 index 0000000..a266eca --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/SimpleExtensionType.java @@ -0,0 +1,44 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for simpleExtensionType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="simpleExtensionType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}extensionType">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *         <group ref="{http://www.w3.org/2001/XMLSchema}attrDecls"/>
+ *       </sequence>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "simpleExtensionType") +public class SimpleExtensionType + extends ExtensionType +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/SimpleRestrictionType.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/SimpleRestrictionType.java new file mode 100644 index 0000000..a3792b6 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/SimpleRestrictionType.java @@ -0,0 +1,47 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for simpleRestrictionType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="simpleRestrictionType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}restrictionType">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *         <choice minOccurs="0">
+ *           <group ref="{http://www.w3.org/2001/XMLSchema}simpleRestrictionModel"/>
+ *         </choice>
+ *         <group ref="{http://www.w3.org/2001/XMLSchema}attrDecls"/>
+ *       </sequence>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "simpleRestrictionType") +public class SimpleRestrictionType + extends RestrictionType +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/SimpleType.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/SimpleType.java new file mode 100644 index 0000000..9474ac6 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/SimpleType.java @@ -0,0 +1,192 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import java.util.ArrayList; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + + +/** + *

Java class for simpleType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="simpleType">
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <group ref="{http://www.w3.org/2001/XMLSchema}simpleDerivation"/>
+ *       <attribute name="final" type="{http://www.w3.org/2001/XMLSchema}simpleDerivationSet" />
+ *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}NCName" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "simpleType", propOrder = { + "restriction", + "list", + "union" +}) +@XmlSeeAlso({ + TopLevelSimpleType.class, + LocalSimpleType.class +}) +public abstract class SimpleType + extends Annotated +{ + + protected Restriction restriction; + protected org.w3._2001.xmlschema.List list; + protected Union union; + @XmlAttribute(name = "final") + @XmlSchemaType(name = "simpleDerivationSet") + protected java.util.List _final; + @XmlAttribute(name = "name") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NCName") + protected String name; + + /** + * Gets the value of the restriction property. + * + * @return + * possible object is + * {@link Restriction } + * + */ + public Restriction getRestriction() { + return restriction; + } + + /** + * Sets the value of the restriction property. + * + * @param value + * allowed object is + * {@link Restriction } + * + */ + public void setRestriction(Restriction value) { + this.restriction = value; + } + + /** + * Gets the value of the list property. + * + * @return + * possible object is + * {@link org.w3._2001.xmlschema.List } + * + */ + public org.w3._2001.xmlschema.List getList() { + return list; + } + + /** + * Sets the value of the list property. + * + * @param value + * allowed object is + * {@link org.w3._2001.xmlschema.List } + * + */ + public void setList(org.w3._2001.xmlschema.List value) { + this.list = value; + } + + /** + * Gets the value of the union property. + * + * @return + * possible object is + * {@link Union } + * + */ + public Union getUnion() { + return union; + } + + /** + * Sets the value of the union property. + * + * @param value + * allowed object is + * {@link Union } + * + */ + public void setUnion(Union value) { + this.union = value; + } + + /** + * Gets the value of the final property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the final property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getFinal().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public java.util.List getFinal() { + if (_final == null) { + _final = new ArrayList(); + } + return this._final; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TopLevelAttribute.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TopLevelAttribute.java new file mode 100644 index 0000000..9eedbb1 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TopLevelAttribute.java @@ -0,0 +1,45 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for topLevelAttribute complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="topLevelAttribute">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}attribute">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *         <element name="simpleType" type="{http://www.w3.org/2001/XMLSchema}localSimpleType" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "topLevelAttribute") +public class TopLevelAttribute + extends Attribute +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TopLevelComplexType.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TopLevelComplexType.java new file mode 100644 index 0000000..0ba6724 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TopLevelComplexType.java @@ -0,0 +1,45 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for topLevelComplexType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="topLevelComplexType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}complexType">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *         <group ref="{http://www.w3.org/2001/XMLSchema}complexTypeModel"/>
+ *       </sequence>
+ *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "topLevelComplexType") +public class TopLevelComplexType + extends ComplexType +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TopLevelElement.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TopLevelElement.java new file mode 100644 index 0000000..5130d8c --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TopLevelElement.java @@ -0,0 +1,49 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for topLevelElement complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="topLevelElement">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}element">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *         <choice minOccurs="0">
+ *           <element name="simpleType" type="{http://www.w3.org/2001/XMLSchema}localSimpleType"/>
+ *           <element name="complexType" type="{http://www.w3.org/2001/XMLSchema}localComplexType"/>
+ *         </choice>
+ *         <group ref="{http://www.w3.org/2001/XMLSchema}identityConstraint" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "topLevelElement") +public class TopLevelElement + extends Element +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TopLevelSimpleType.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TopLevelSimpleType.java new file mode 100644 index 0000000..e2e0c8f --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TopLevelSimpleType.java @@ -0,0 +1,45 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for topLevelSimpleType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="topLevelSimpleType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}simpleType">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *         <group ref="{http://www.w3.org/2001/XMLSchema}simpleDerivation"/>
+ *       </sequence>
+ *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "topLevelSimpleType") +public class TopLevelSimpleType + extends SimpleType +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TotalDigits.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TotalDigits.java new file mode 100644 index 0000000..9012af2 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TotalDigits.java @@ -0,0 +1,46 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}numFacet">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@XmlRootElement(name = "totalDigits") +public class TotalDigits + extends NumFacet +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TypeDerivationControl.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TypeDerivationControl.java new file mode 100644 index 0000000..46dae81 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/TypeDerivationControl.java @@ -0,0 +1,64 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for typeDerivationControl. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="typeDerivationControl">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}derivationControl">
+ *     <enumeration value="extension"/>
+ *     <enumeration value="restriction"/>
+ *     <enumeration value="list"/>
+ *     <enumeration value="union"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "typeDerivationControl") +@XmlEnum(DerivationControl.class) +public enum TypeDerivationControl { + + @XmlEnumValue("extension") + EXTENSION(DerivationControl.EXTENSION), + @XmlEnumValue("restriction") + RESTRICTION(DerivationControl.RESTRICTION), + @XmlEnumValue("list") + LIST(DerivationControl.LIST), + @XmlEnumValue("union") + UNION(DerivationControl.UNION); + private final DerivationControl value; + + TypeDerivationControl(DerivationControl v) { + value = v; + } + + public DerivationControl value() { + return value; + } + + public static TypeDerivationControl fromValue(DerivationControl v) { + for (TypeDerivationControl c: TypeDerivationControl.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v.toString()); + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Union.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Union.java new file mode 100644 index 0000000..600e01d --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Union.java @@ -0,0 +1,122 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + + +/** + * + * memberTypes attribute must be non-empty or there must be + * at least one simpleType child + * + * + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <sequence>
+ *         <element name="simpleType" type="{http://www.w3.org/2001/XMLSchema}localSimpleType" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="memberTypes">
+ *         <simpleType>
+ *           <list itemType="{http://www.w3.org/2001/XMLSchema}QName" />
+ *         </simpleType>
+ *       </attribute>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "simpleType" +}) +@XmlRootElement(name = "union") +public class Union + extends Annotated +{ + + protected List simpleType; + @XmlAttribute(name = "memberTypes") + protected List memberTypes; + + /** + * Gets the value of the simpleType property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the simpleType property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getSimpleType().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link LocalSimpleType } + * + * + */ + public List getSimpleType() { + if (simpleType == null) { + simpleType = new ArrayList(); + } + return this.simpleType; + } + + /** + * Gets the value of the memberTypes property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the memberTypes property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getMemberTypes().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link QName } + * + * + */ + public List getMemberTypes() { + if (memberTypes == null) { + memberTypes = new ArrayList(); + } + return this.memberTypes; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/WhiteSpace.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/WhiteSpace.java new file mode 100644 index 0000000..f5cd1d5 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/WhiteSpace.java @@ -0,0 +1,54 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}facet">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="value" use="required">
+ *         <simpleType>
+ *           <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+ *             <enumeration value="preserve"/>
+ *             <enumeration value="replace"/>
+ *             <enumeration value="collapse"/>
+ *           </restriction>
+ *         </simpleType>
+ *       </attribute>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@XmlRootElement(name = "whiteSpace") +public class WhiteSpace + extends Facet +{ + + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Wildcard.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Wildcard.java new file mode 100644 index 0000000..698bbdf --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/Wildcard.java @@ -0,0 +1,123 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + + +package org.w3._2001.xmlschema; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + + +/** + *

Java class for wildcard complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="wildcard">
+ *   <complexContent>
+ *     <extension base="{http://www.w3.org/2001/XMLSchema}annotated">
+ *       <attribute name="namespace" type="{http://www.w3.org/2001/XMLSchema}namespaceList" default="##any" />
+ *       <attribute name="processContents" default="strict">
+ *         <simpleType>
+ *           <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+ *             <enumeration value="skip"/>
+ *             <enumeration value="lax"/>
+ *             <enumeration value="strict"/>
+ *           </restriction>
+ *         </simpleType>
+ *       </attribute>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "wildcard") +@XmlSeeAlso({ + Any.class +}) +public class Wildcard + extends Annotated +{ + + @XmlAttribute(name = "namespace") + @XmlSchemaType(name = "namespaceList") + protected List namespace; + @XmlAttribute(name = "processContents") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + protected String processContents; + + /** + * Gets the value of the namespace property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the namespace property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getNamespace().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getNamespace() { + if (namespace == null) { + namespace = new ArrayList(); + } + return this.namespace; + } + + /** + * Gets the value of the processContents property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getProcessContents() { + if (processContents == null) { + return "strict"; + } else { + return processContents; + } + } + + /** + * Sets the value of the processContents property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setProcessContents(String value) { + this.processContents = value; + } + +} diff --git a/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/package-info.java b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/package-info.java new file mode 100644 index 0000000..88470b8 --- /dev/null +++ b/org.simantics.xml.sax/src/org/w3/_2001/xmlschema/package-info.java @@ -0,0 +1,9 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.06.17 at 02:58:58 PM EEST +// + +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.w3.org/2001/XMLSchema", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +package org.w3._2001.xmlschema; -- 2.45.2