|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tuscany.sdo.helper.XSDHelperImpl
public class XSDHelperImpl
Provides access to additional information when the Type or Property is defined by an XML Schema (XSD). Methods return null/false otherwise or if the information is unavailable. Defines Types from an XSD.
Field Summary | |
---|---|
protected boolean |
extensibleNamespaces
|
protected HelperContext |
helperContext
|
protected SDOXSDEcoreBuilder |
nondelegatingEcoreBuilder
|
protected HashMap |
tcclToEcoreBuilderMap
|
Fields inherited from interface commonj.sdo.helper.XSDHelper |
---|
INSTANCE |
Constructor Summary | |
---|---|
XSDHelperImpl(HelperContext hc)
|
|
XSDHelperImpl(HelperContext hc,
String redefineBuiltIn,
boolean extensibleNamespaces)
|
Method Summary | |
---|---|
protected SDOXSDEcoreBuilder |
createEcoreBuilder()
|
protected List |
define(InputSource inputSource,
String schemaLocation)
|
List |
define(InputStream xsdInputStream,
String schemaLocation)
Define XML Schema as Types. |
List |
define(Reader xsdReader,
String schemaLocation)
Define XML Schema as Types. |
List |
define(String xsd)
Define the XML Schema as Types. |
String |
generate(List types)
Generate an XML Schema Declaration (XSD) from Types. |
String |
generate(List types,
Map namespaceToSchemaLocation)
Generate an XML Schema Declaration (XSD) from Types. |
protected String |
getAppinfo(org.eclipse.emf.ecore.EModelElement eModelElement,
String source)
|
String |
getAppinfo(Property property,
String source)
Return the content of the appinfo declared for this Property and source. |
String |
getAppinfo(Type type,
String source)
Return the appinfo declared for this Type and source. |
protected SDOXSDEcoreBuilder |
getEcoreBuilder()
|
Property |
getGlobalProperty(String uri,
String propertyName,
boolean isElement)
Returns the Property defined by the named global element or attribute in the targetNamespace uri, or null if not found. |
HelperContext |
getHelperContext()
|
String |
getLocalName(Property property)
Returns the local name as declared in the XSD. |
String |
getLocalName(Type type)
Returns the local name as declared in the XSD. |
String |
getNamespaceURI(Property property)
Returns the namespace URI as declared in the XSD. |
boolean |
isAttribute(Property property)
Returns true if the property is declared as an attribute in the XSD. |
boolean |
isElement(Property property)
Returns true if the property is declared as an element in the XSD. |
boolean |
isMixed(Type type)
Returns true if the Type is declared to contain mixed content. |
boolean |
isXSD(Type type)
Indicates if this helper contains XSD information for the specified type. |
protected void |
putTCCLEcoreBuilder(org.eclipse.xsd.ecore.XSDEcoreBuilder ecoreBuilder)
|
void |
setExtensibleNamespaces(boolean extensibleNamespaces)
|
void |
setRedefineBuiltIn(String redefineBuiltIn)
Redefine/regenerating the built-in model |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean extensibleNamespaces
protected HelperContext helperContext
protected SDOXSDEcoreBuilder nondelegatingEcoreBuilder
protected HashMap tcclToEcoreBuilderMap
Constructor Detail |
---|
public XSDHelperImpl(HelperContext hc, String redefineBuiltIn, boolean extensibleNamespaces)
public XSDHelperImpl(HelperContext hc)
Method Detail |
---|
public void setRedefineBuiltIn(String redefineBuiltIn)
redefineBuiltIn
- public void setExtensibleNamespaces(boolean extensibleNamespaces)
protected SDOXSDEcoreBuilder createEcoreBuilder()
protected void putTCCLEcoreBuilder(org.eclipse.xsd.ecore.XSDEcoreBuilder ecoreBuilder)
protected SDOXSDEcoreBuilder getEcoreBuilder()
public String getLocalName(Type type)
XSDHelper
getLocalName
in interface XSDHelper
type
- to return local name for.
public String getLocalName(Property property)
XSDHelper
getLocalName
in interface XSDHelper
property
- to return local name for.
public String getNamespaceURI(Property property)
XSDHelper
getNamespaceURI
in interface XSDHelper
property
- to return namespace URI for.
public boolean isAttribute(Property property)
XSDHelper
isAttribute
in interface XSDHelper
property
- to identify if an attribute.
public boolean isElement(Property property)
XSDHelper
isElement
in interface XSDHelper
property
- to identify if an element.
public boolean isMixed(Type type)
XSDHelper
isMixed
in interface XSDHelper
type
- to identify if mixed content.
public boolean isXSD(Type type)
XSDHelper
isXSD
in interface XSDHelper
type
- the type.
public Property getGlobalProperty(String uri, String propertyName, boolean isElement)
XSDHelper
getGlobalProperty
in interface XSDHelper
uri
- The uri of the targetNamespace.propertyName
- The name of the global property.isElement
- is true for global elements, false for global attributes.
public String getAppinfo(Type type, String source)
XSDHelper
getAppinfo
in interface XSDHelper
type
- the type with the appinfo declarationsource
- the source of the appinfo declaration.
public String getAppinfo(Property property, String source)
XSDHelper
getAppinfo
in interface XSDHelper
property
- the Property with the appinfo declarationsource
- the source of the appinfo declaration.
protected String getAppinfo(org.eclipse.emf.ecore.EModelElement eModelElement, String source)
public List define(String xsd)
XSDHelper
define
in interface XSDHelper
xsd
- the XML Schema.
public List define(Reader xsdReader, String schemaLocation)
XSDHelper
define
in interface XSDHelper
xsdReader
- reader to an XML Schema.schemaLocation
- the URI of the location of the schema, used
for processing relative imports and includes. May be null if not used.
public List define(InputStream xsdInputStream, String schemaLocation)
XSDHelper
define
in interface XSDHelper
xsdInputStream
- input stream to an XML Schema.schemaLocation
- the URI of the location of the schema, used
for processing relative imports and includes. May be null if not used.
protected List define(InputSource inputSource, String schemaLocation)
public String generate(List types) throws IllegalArgumentException
XSDHelper
generate
in interface XSDHelper
types
- a List containing the Types
IllegalArgumentException
- if the XSD could not be generated.public String generate(List types, Map namespaceToSchemaLocation) throws IllegalArgumentException
XSDHelper
generate
in interface XSDHelper
types
- a List containing the TypesnamespaceToSchemaLocation
- map of target namespace to schema locations or null
IllegalArgumentException
- if the XSD could not be generated.public HelperContext getHelperContext()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |