de.interactive_instruments.ShapeChange.Target.XmlSchema
Class XsdDocument

java.lang.Object
  extended by de.interactive_instruments.ShapeChange.Target.XmlSchema.XsdDocument
All Implemented Interfaces:
MessageSource

public class XsdDocument
extends Object
implements MessageSource


Field Summary
protected  Document document
           
protected  Comment hook
           
protected  Vector<String> imports
           
protected  Vector<String> includes
           
protected  Model model
           
protected  String name
           
protected  String okstra
           
protected  String okstraKeyValueBaseType
           
protected  String okstraKeyValuePropertyType
           
protected  String okstraObjectRefType
           
protected  String okstraPrefix
           
protected  Options options
           
protected  String outputDirectory
           
protected  boolean printed
           
 ShapeChangeResult result
           
protected  Element root
           
protected  String targetNamespace
           
 
Constructor Summary
XsdDocument(PackageInfo pi, Model m, Options o, ShapeChangeResult r, String n)
           
 
Method Summary
protected  void addAttribute(Element e, String name, String value)
          Add attribute to an element
protected  Comment addHook(Element e)
          Add a comment
 void addImport(String nsabr, String ns)
           
 void addInclude(XsdDocument xsd)
           
protected  Element addProperty(ClassInfo cibase, PropertyInfo pi, Multiplicity m, SchematronSchema schDoc)
          Process a single property.
protected  void addStandardAnnotation(Element e, Info info)
          Add documentation and tagged values to an element
protected  String mapBaseType(ClassInfo ci)
          Map a base type of a class to a predefined representation in GML, ISO/TS 19139, etc.
protected  String mapElement(ClassInfo ci)
          Map an element to a predefined representation in GML, ISO/TS 19139, etc.
protected  boolean mapPropertyType(ClassInfo cibase, PropertyInfo propi, Element e, boolean inAssocClass, SchematronSchema schDoc)
          Set the type for a property element.
 String message(int mnr)
          This method returns messages belonging to the XML Schema target by their message number.
protected  String messageText(int mnr)
          This is the message text provision proper.
 Element pComplexType(ClassInfo ci, ClassInfo cibase, SchematronSchema schDoc)
          
 void pGlobalBasicType(ClassInfo ci)
           
 void pGlobalCodeList(ClassInfo ci)
          Create code list encoding according to standard GML 3.2 encoding rule (union between enumeration and other-pattern)
 void pGlobalEnumeration(ClassInfo ci)
           
 Element pGroup(ClassInfo ci, ClassInfo cibase)
          
 void pObjectElement(ClassInfo ci, ClassInfo cibase)
          Create global element for an object / data type instance
 void pOKSTRAKEYPropertyType(ClassInfo ci)
           
 void pPropertyTypes(ClassInfo ci)
           
 void pPropertyTypeWithGroup(ClassInfo ci)
           
 void pPropertyTypeWithSubtypes(ClassInfo ci)
           
 boolean printed()
           
 void printFile(Properties outputFormat)
          Dump XML Schema file
 boolean processLocalProperties(ClassInfo ci, Element sequenceOrChoice, SchematronSchema schDoc)
          Process all properties that are added in this class.
 boolean processLocalProperty(ClassInfo ci, PropertyInfo pi, Element sequenceOrChoice, Multiplicity m, SchematronSchema schDoc)
          Process a class property.
 void pValueTypeGroup(ClassInfo ci)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

document

protected Document document

root

protected Element root

hook

protected Comment hook

options

protected Options options

result

public ShapeChangeResult result

model

protected Model model

name

protected String name

includes

protected Vector<String> includes

imports

protected Vector<String> imports

printed

protected boolean printed

targetNamespace

protected String targetNamespace

outputDirectory

protected String outputDirectory

okstraKeyValuePropertyType

protected String okstraKeyValuePropertyType

okstraKeyValueBaseType

protected String okstraKeyValueBaseType

okstraObjectRefType

protected String okstraObjectRefType

okstraPrefix

protected String okstraPrefix

okstra

protected String okstra
Constructor Detail

XsdDocument

public XsdDocument(PackageInfo pi,
                   Model m,
                   Options o,
                   ShapeChangeResult r,
                   String n)
            throws ShapeChangeAbortException,
                   ParserConfigurationException
Throws:
ShapeChangeAbortException
ParserConfigurationException
Method Detail

addAttribute

protected void addAttribute(Element e,
                            String name,
                            String value)
Add attribute to an element


addHook

protected Comment addHook(Element e)
Add a comment


addStandardAnnotation

protected void addStandardAnnotation(Element e,
                                     Info info)
Add documentation and tagged values to an element


mapBaseType

protected String mapBaseType(ClassInfo ci)
Map a base type of a class to a predefined representation in GML, ISO/TS 19139, etc.


mapElement

protected String mapElement(ClassInfo ci)
Map an element to a predefined representation in GML, ISO/TS 19139, etc.


pObjectElement

public void pObjectElement(ClassInfo ci,
                           ClassInfo cibase)
Create global element for an object / data type instance


pComplexType

public Element pComplexType(ClassInfo ci,
                            ClassInfo cibase,
                            SchematronSchema schDoc)


pValueTypeGroup

public void pValueTypeGroup(ClassInfo ci)

pGroup

public Element pGroup(ClassInfo ci,
                      ClassInfo cibase)


pPropertyTypeWithSubtypes

public void pPropertyTypeWithSubtypes(ClassInfo ci)

pPropertyTypes

public void pPropertyTypes(ClassInfo ci)

pPropertyTypeWithGroup

public void pPropertyTypeWithGroup(ClassInfo ci)

pOKSTRAKEYPropertyType

public void pOKSTRAKEYPropertyType(ClassInfo ci)

pGlobalBasicType

public void pGlobalBasicType(ClassInfo ci)
Parameters:
ci -

pGlobalEnumeration

public void pGlobalEnumeration(ClassInfo ci)

pGlobalCodeList

public void pGlobalCodeList(ClassInfo ci)
Create code list encoding according to standard GML 3.2 encoding rule (union between enumeration and other-pattern)

Parameters:
ci - the code list class

processLocalProperty

public boolean processLocalProperty(ClassInfo ci,
                                    PropertyInfo pi,
                                    Element sequenceOrChoice,
                                    Multiplicity m,
                                    SchematronSchema schDoc)
Process a class property. "true" is returned, if the property is an aggregation/composition, "false" otherwise


processLocalProperties

public boolean processLocalProperties(ClassInfo ci,
                                      Element sequenceOrChoice,
                                      SchematronSchema schDoc)
Process all properties that are added in this class. "true" is returned if a single property is an aggregation/composition, "false" otherwise


addProperty

protected Element addProperty(ClassInfo cibase,
                              PropertyInfo pi,
                              Multiplicity m,
                              SchematronSchema schDoc)
Process a single property.


mapPropertyType

protected boolean mapPropertyType(ClassInfo cibase,
                                  PropertyInfo propi,
                                  Element e,
                                  boolean inAssocClass,
                                  SchematronSchema schDoc)
Set the type for a property element.

Parameters:
cibase - class that owns the property
propi - the property
e - property element
inAssocClass - flag is set, if the class is an association class
schDoc - Schematron schema, optional
Returns:
true, if the multiplicity of the property element has already been set, false otherwise

addInclude

public void addInclude(XsdDocument xsd)

addImport

public void addImport(String nsabr,
                      String ns)

printFile

public void printFile(Properties outputFormat)
               throws Exception
Dump XML Schema file

Throws:
Exception

printed

public boolean printed()

message

public String message(int mnr)

This method returns messages belonging to the XML Schema target by their message number. The organization corresponds to the logic in module ShapeChangeResult. All functions in that class, which require an message number can be redirected to the function at hand.

Specified by:
message in interface MessageSource
Parameters:
mnr - Message number
Returns:
Message text, including $x$ substitution points.

messageText

protected String messageText(int mnr)
This is the message text provision proper. It returns a message for a number.

Parameters:
mnr - Message number
Returns:
Message text or null


Copyright © 2015. All rights reserved.