ma2proto-xsom.1.97.source-code.simpleType.rng Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of schema2proto-xsom Show documentation
Show all versions of schema2proto-xsom Show documentation
XML Schema Object Model (XSOM) is a Java library that allows applications to easily parse XML Schema
documents and inspect information in them. It is expected to be useful for applications that need to take XML
Schema as an input.
The newest version!
/** computed simple type object */
private SimpleTypeImpl result;
private Locator locator;
private Set finalSet;
private Set makeFinalSet(String finalValue) {
if(finalValue==null)
return Collections.EMPTY_SET;
Set s = new LinkedHashSet();
StringTokenizer tokens = new StringTokenizer(finalValue);
while(tokens.hasMoreTokens()) {
String token = tokens.nextToken();
if(token.equals("#all")) {
s.add(XSVariety.ATOMIC);
s.add(XSVariety.UNION);
s.add(XSVariety.LIST);
}
if(token.equals("list")) {
s.add(XSVariety.LIST);
}
if(token.equals("union")) {
s.add(XSVariety.UNION);
}
if(token.equals("restriction")) {
s.add(XSVariety.ATOMIC);
}
}
return s;
}
locator=$runtime.copyLocator();
finalValue =
fa = (fa);
annotation = (null,AnnotationContext.SIMPLETYPE_DECL);
finalSet = makeFinalSet(finalValue);
/** computed simple type object */
private RestrictionSimpleTypeImpl result;
// reference to the base type
private Ref.SimpleType baseType;
// location of restriction
private Locator rloc;
rloc=$runtime.copyLocator();
fa = (fa);
baseType = new DelayedRef.SimpleType(
$runtime, rloc, $runtime.currentSchema, baseTypeName );
result = new RestrictionSimpleTypeImpl(
$runtime.document, annotation, locator, fa, name, name==null, finalSet, baseType );
result.addFacet(facet);
private FacetImpl result;
private Locator locator;
minExclusive
maxExclusive
minInclusive
maxInclusive
totalDigits
fractionDigits
length
maxLength
minLength
enumeration
whiteSpace
pattern
locator=$runtime.copyLocator();
fa = (fa);
result = new FacetImpl( $runtime.document,
annotation, locator, fa, $localName/*name of the facet*/,
$runtime.createXmlString(value), $runtime.parseBoolean(fixed) );
/** computed simple type object */
private ListSimpleTypeImpl result;
// reference to the base type
private Ref.SimpleType itemType;
// locator of <list>
private Locator lloc;
lloc=$runtime.copyLocator();
fa = (fa);
itemType = new DelayedRef.SimpleType(
$runtime, lloc, $runtime.currentSchema, itemTypeName);
result = new ListSimpleTypeImpl(
$runtime.document, annotation, locator, fa,
name, name==null, finalSet, itemType );
import java.util.Vector;
/** computed simple type object */
private UnionSimpleTypeImpl result;
// Vector of Ref.SimpleType
private final Vector members = new Vector();
// locator of <union>
private Locator uloc;
uloc=$runtime.copyLocator();
fa = (fa);
members.add(anonymousMemberType);
result = new UnionSimpleTypeImpl(
$runtime.document, annotation, locator, fa, name, name==null, finalSet,
(Ref.SimpleType[])members.toArray(new Ref.SimpleType[members.size()]) );