jInfer

cz.cuni.mff.ksi.jinfer.xsdimporter.utils
Class XSDUtility

java.lang.Object
  extended by cz.cuni.mff.ksi.jinfer.xsdimporter.utils.XSDUtility

public final class XSDUtility
extends Object

Utility class providing convenience methods for importing XSD Schema documents.


Field Summary
static String OPTIONAL
          String for attribute value of use attribute, indicating optional usage.
static String REQUIRED
          String for attribute value of use attribute, indicating compulsory usage.
static String SIMPLE_DATA_NAME
          Name of SimpleData children of TOKEN Elements, holding the simple data type information for XSD exporter.
static String UNBOUNDED
          String for attribute value of maxOccurs attribute, indicating unlimited occurrence.
 
Method Summary
static void getRulesFromElement(Element root, List<Element> elementRules)
          Extract all rules from a subtree of Element, not including the root itself.
static boolean isNCName(String name)
          Check if name is unqualified (does not contain a colon).
static Map<String,Object> prepareMetadata(RegexpInterval interval)
          Create metadata for an element.
static void setLambda(Element ret)
          Set the parameter to RegexpType.LAMBDA element, with all the valid constraints and make it immutable.
static String trimNS(String qName)
          Trims (cuts) namespace prefix from the beginning of element tag and returns it in original case.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNBOUNDED

public static final String UNBOUNDED
String for attribute value of maxOccurs attribute, indicating unlimited occurrence.

See Also:
Constant Field Values

REQUIRED

public static final String REQUIRED
String for attribute value of use attribute, indicating compulsory usage.

See Also:
Constant Field Values

OPTIONAL

public static final String OPTIONAL
String for attribute value of use attribute, indicating optional usage.

See Also:
Constant Field Values

SIMPLE_DATA_NAME

public static final String SIMPLE_DATA_NAME
Name of SimpleData children of TOKEN Elements, holding the simple data type information for XSD exporter.

See Also:
Constant Field Values
Method Detail

getRulesFromElement

public static void getRulesFromElement(Element root,
                                       List<Element> elementRules)
                                throws InterruptedException
Extract all rules from a subtree of Element, not including the root itself.

Parameters:
root - Root of the subtree from which we extract the rules.
elementRules - List where all the rules are stored.
Throws:
InterruptedException - When user interrupts operation.

trimNS

public static String trimNS(String qName)
Trims (cuts) namespace prefix from the beginning of element tag and returns it in original case.

Parameters:
qName - String to be trimmed of its prefix.
Returns:
QName without namespace prefix.

isNCName

public static boolean isNCName(String name)
Check if name is unqualified (does not contain a colon).

Parameters:
name - Name to be checked.
Returns:
true if name has no colon (':').

prepareMetadata

public static Map<String,Object> prepareMetadata(RegexpInterval interval)
Create metadata for an element. This should contain information about element interval and information that the element was parsed from schema.

Parameters:
interval - Valid interval specifying element occurrence limits.
Returns:
New metadata.

setLambda

public static void setLambda(Element ret)
Set the parameter to RegexpType.LAMBDA element, with all the valid constraints and make it immutable.

Parameters:
ret - Element to set as LAMBDA.

jInfer

Generated on Fri Dec 9 00:01:25 CET 2011