.jaxb.xsom.3.0.1.source-code.element.rng Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xsom Show documentation
Show all versions of 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.
private boolean form;
private boolean formSpecified;
private Ref.Type type;
private List idcs = new ArrayList(); // identity constraints
private DelayedRef.Element substHeadRef;
private ElementDecl makeResult() {
if(finalValue==null)
finalValue = new Integer($runtime.finalDefault);
if(blockValue==null)
blockValue = new Integer($runtime.blockDefault);
if(!formSpecified)
form = $runtime.elementFormDefault;
if(isGlobal) // global elements are always qualified
form = true;
String tns;
if(form) tns = $runtime.currentSchema.getTargetNamespace();
else tns = "";
if( type==null ) {
if( substHeadRef!=null )
type = new SubstGroupBaseTypeRef(substHeadRef);
else
type = $runtime.parser.schemaSet.anyType;
}
ElementDecl ed = new ElementDecl(
$runtime,
$runtime.document,
annotation,
locator,
fa,
tns,
name,
!isGlobal,
$runtime.createXmlString(defaultValue),
$runtime.createXmlString(fixedValue),
$runtime.parseBoolean(nillable),
$runtime.parseBoolean(abstractValue),
(java.lang.Boolean)(formSpecified ? form : null),
type,
substHeadRef,
blockValue.intValue(),
finalValue.intValue(),
idcs);
// if this element has anonymous complex type, it will be set here.
if(type instanceof ComplexTypeImpl)
((ComplexTypeImpl)type).setScope(ed);
return ed;
}
fa = (fa);
formSpecified = true;
substHeadRef = new DelayedRef.Element(
$runtime, locator, $runtime.currentSchema, substRef );
(null,AnnotationContext.ELEMENT_DECL);
type = new DelayedRef.Type(
$runtime, locator, $runtime.currentSchema, typeName );
idc =
idcs.add(idc);
private short category;
private List fields = new ArrayList();
private XPathImpl selector;
private DelayedRef.IdentityConstraint refer = null;
private IdentityConstraintImpl makeResult() {
return new IdentityConstraintImpl($runtime.document,ann,$runtime.copyLocator(),fa,
category,name,selector,fields,refer);
}
key
keyref
unique
if($localName.equals("key"))
category = XSIdentityConstraint.KEY;
else
if($localName.equals("keyref"))
category = XSIdentityConstraint.KEYREF;
else
if($localName.equals("unique"))
category = XSIdentityConstraint.UNIQUE;
fa = (null);
name =
ref =
refer = new DelayedRef.IdentityConstraint(
$runtime, $runtime.copyLocator(), $runtime.currentSchema, ref );
ann = (null,AnnotationContext.IDENTITY_CONSTRAINT);
selector =
field =
fields.add(field);
private XPathImpl makeResult() {
return new XPathImpl($runtime.document,ann,$runtime.copyLocator(),fa,
$runtime.createXmlString(xpath));
}
fa = (null);
xpath =
ann = (null,AnnotationContext.XPATH);
private Integer makeResult() {
if(v==null) return new Integer($runtime.finalDefault);
if(v.indexOf("#all")!=-1)
return new Integer(XSType.EXTENSION|XSType.RESTRICTION);
int r = 0;
if(v.indexOf("extension")!=-1) r|=XSType.EXTENSION;
if(v.indexOf("restriction")!=-1) r|=XSType.RESTRICTION;
return new Integer(r);
}
private Integer makeResult() {
if(v==null) return new Integer($runtime.blockDefault);
if(v.indexOf("#all")!=-1)
return new Integer(
XSType.EXTENSION|XSType.RESTRICTION|XSType.SUBSTITUTION);
int r = 0;
if(v.indexOf("extension")!=-1) r|=XSType.EXTENSION;
if(v.indexOf("restriction")!=-1) r|=XSType.RESTRICTION;
if(v.indexOf("substitution")!=-1) r|=XSType.SUBSTITUTION;
return new Integer(r);
}