Top Description Fields Constructors Methods
com.sun.org.apache.xerces.internal.impl.xs

public Class XSConstraints

extends Object
Class Inheritance
Imports
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter, com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException, .ValidatedInfo, .ValidationContext, .XSSimpleType, com.sun.org.apache.xerces.internal.impl.xs.models.CMBuilder, .XSCMValidator, com.sun.org.apache.xerces.internal.impl.xs.util.SimpleLocator, .XSObjectListImpl, com.sun.org.apache.xerces.internal.util.SymbolHash, com.sun.org.apache.xerces.internal.xs.XSConstants, .XSObjectList, .XSTypeDefinition, java.util.ArrayList, .Collections, .Comparator, .List

Constaints shared by traversers and validator
Author
Sandy Gao, IBM

Field Summary

Modifier and TypeField and Description
private static final Comparator<XSParticleDecl>
private static XSParticleDecl
pack-priv static final int
pack-priv static final XSSimpleType

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
private static boolean
checkComplexDerivation(XSComplexTypeDecl derived, XSTypeDefinition base, short block)

Note

this will be a private method, and it assumes that derived is not anyType.

public static boolean
checkComplexDerivationOk(XSComplexTypeDecl derived, XSTypeDefinition base, short block)

check whether complex type derived is valid derived from base, given a subset of {restriction, extension}.

public static void
private static void
private static void
checkMapAndSum(List<XSParticleDecl> dChildren, int min1, int max1, SubstitutionGroupHandler dSGHandler, List<XSParticleDecl> bChildren, int min2, int max2, SubstitutionGroupHandler bSGHandler)

private static void
checkNameAndTypeOK(XSElementDecl dElement, int dMin, int dMax, XSElementDecl bElement, int bMin, int bMax)

private static void
checkNSCompat(XSElementDecl elem, int min1, int max1, XSWildcardDecl wildcard, int min2, int max2, boolean checkWCOccurrence)

private static void
checkNSRecurseCheckCardinality(List<XSParticleDecl> children, int min1, int max1, SubstitutionGroupHandler dSGHandler, XSParticleDecl wildcard, int min2, int max2, boolean checkWCOccurrence)

private static void
checkNSSubset(XSWildcardDecl dWildcard, int min1, int max1, XSWildcardDecl bWildcard, int min2, int max2)

private static boolean
checkOccurrenceRange(int min1, int max1, int min2, int max2)

private static void
checkRecurse(List<XSParticleDecl> dChildren, int min1, int max1, SubstitutionGroupHandler dSGHandler, List<XSParticleDecl> bChildren, int min2, int max2, SubstitutionGroupHandler bSGHandler)

private static void
checkRecurseLax(List<XSParticleDecl> dChildren, int min1, int max1, SubstitutionGroupHandler dSGHandler, List<XSParticleDecl> bChildren, int min2, int max2, SubstitutionGroupHandler bSGHandler)

private static void
checkRecurseUnordered(List<XSParticleDecl> dChildren, int min1, int max1, SubstitutionGroupHandler dSGHandler, List<XSParticleDecl> bChildren, int min2, int max2, SubstitutionGroupHandler bSGHandler)

private static boolean
checkSimpleDerivation(XSSimpleType derived, XSSimpleType base, short block)

Note

this will be a private method, and it assumes that derived is not anySimpleType, and base is not anyType.

public static boolean
checkSimpleDerivationOk(XSSimpleType derived, XSTypeDefinition base, short block)

check whether simple type derived is valid derived from base, given a subset of {restriction, extension}.

public static boolean
checkTypeDerivationOk(XSTypeDefinition derived, XSTypeDefinition base, short block)

check whether derived is valid derived from base, given a subset of {restriction, extension}.B

public static Object
ElementDefaultValidImmediate(XSTypeDefinition type, String value, ValidationContext context, ValidatedInfo vinfo)

check whether a value is a valid default for some type returns the compiled form of the value The parameter value could be either a String or a ValidatedInfo object

public static void
public static void
fullSchemaChecking(XSGrammarBucket grammarBucket, SubstitutionGroupHandler SGHandler, CMBuilder cmBuilder, XMLErrorReporter errorReporter)

used to check the 3 constraints against each complex type (should be each model group): Unique Particle Attribution, Particle Derivation (Restriction), Element Declrations Consistent.

private static void
gatherChildren(int parentType, XSParticleDecl p, List<XSParticleDecl> children)

public static XSParticleDecl
private static XSParticleDecl
public static boolean
public static boolean
public static boolean
public static boolean
private static boolean
private static boolean
particleValidRestriction(XSParticleDecl dParticle, SubstitutionGroupHandler dSGHandler, XSParticleDecl bParticle, SubstitutionGroupHandler bSGHandler, boolean checkWCOccurrence)

private static List<XSParticleDecl>
pack-priv static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ELEMENT_PARTICLE_COMPARATORback to summary
private static final Comparator<XSParticleDecl> ELEMENT_PARTICLE_COMPARATOR
fEmptyParticleback to summary
private static XSParticleDecl fEmptyParticle
OCCURRENCE_UNKNOWNback to summary
pack-priv static final int OCCURRENCE_UNKNOWN
STRING_TYPEback to summary
pack-priv static final XSSimpleType STRING_TYPE

Constructor Detail

XSConstraintsback to summary
public XSConstraints()

Method Detail

addElementToParticleVectorback to summary
private static void addElementToParticleVector(List<XSParticleDecl> v, XSElementDecl d)
checkComplexDerivationback to summary
private static boolean checkComplexDerivation(XSComplexTypeDecl derived, XSTypeDefinition base, short block)

Note

this will be a private method, and it assumes that derived is not anyType. Another method will be introduced for public use, which will call this method.

checkComplexDerivationOkback to summary
public static boolean checkComplexDerivationOk(XSComplexTypeDecl derived, XSTypeDefinition base, short block)

check whether complex type derived is valid derived from base, given a subset of {restriction, extension}.

checkElementDeclsConsistentback to summary
public static void checkElementDeclsConsistent(XSComplexTypeDecl type, XSParticleDecl particle, SymbolHash elemDeclHash, SubstitutionGroupHandler sgHandler) throws XMLSchemaException
checkIDConstraintRestrictionback to summary
private static void checkIDConstraintRestriction(XSElementDecl derivedElemDecl, XSElementDecl baseElemDecl) throws XMLSchemaException
checkMapAndSumback to summary
private static void checkMapAndSum(List<XSParticleDecl> dChildren, int min1, int max1, SubstitutionGroupHandler dSGHandler, List<XSParticleDecl> bChildren, int min2, int max2, SubstitutionGroupHandler bSGHandler) throws XMLSchemaException
checkNameAndTypeOKback to summary
private static void checkNameAndTypeOK(XSElementDecl dElement, int dMin, int dMax, XSElementDecl bElement, int bMin, int bMax) throws XMLSchemaException
checkNSCompatback to summary
private static void checkNSCompat(XSElementDecl elem, int min1, int max1, XSWildcardDecl wildcard, int min2, int max2, boolean checkWCOccurrence) throws XMLSchemaException
checkNSRecurseCheckCardinalityback to summary
private static void checkNSRecurseCheckCardinality(List<XSParticleDecl> children, int min1, int max1, SubstitutionGroupHandler dSGHandler, XSParticleDecl wildcard, int min2, int max2, boolean checkWCOccurrence) throws XMLSchemaException
checkNSSubsetback to summary
private static void checkNSSubset(XSWildcardDecl dWildcard, int min1, int max1, XSWildcardDecl bWildcard, int min2, int max2) throws XMLSchemaException
checkOccurrenceRangeback to summary
private static boolean checkOccurrenceRange(int min1, int max1, int min2, int max2)
checkRecurseback to summary
private static void checkRecurse(List<XSParticleDecl> dChildren, int min1, int max1, SubstitutionGroupHandler dSGHandler, List<XSParticleDecl> bChildren, int min2, int max2, SubstitutionGroupHandler bSGHandler) throws XMLSchemaException
checkRecurseLaxback to summary
private static void checkRecurseLax(List<XSParticleDecl> dChildren, int min1, int max1, SubstitutionGroupHandler dSGHandler, List<XSParticleDecl> bChildren, int min2, int max2, SubstitutionGroupHandler bSGHandler) throws XMLSchemaException
checkRecurseUnorderedback to summary
private static void checkRecurseUnordered(List<XSParticleDecl> dChildren, int min1, int max1, SubstitutionGroupHandler dSGHandler, List<XSParticleDecl> bChildren, int min2, int max2, SubstitutionGroupHandler bSGHandler) throws XMLSchemaException
checkSimpleDerivationback to summary
private static boolean checkSimpleDerivation(XSSimpleType derived, XSSimpleType base, short block)

Note

this will be a private method, and it assumes that derived is not anySimpleType, and base is not anyType. Another method will be introduced for public use, which will call this method.

checkSimpleDerivationOkback to summary
public static boolean checkSimpleDerivationOk(XSSimpleType derived, XSTypeDefinition base, short block)

check whether simple type derived is valid derived from base, given a subset of {restriction, extension}.

checkTypeDerivationOkback to summary
public static boolean checkTypeDerivationOk(XSTypeDefinition derived, XSTypeDefinition base, short block)

check whether derived is valid derived from base, given a subset of {restriction, extension}.B

ElementDefaultValidImmediateback to summary
public static Object ElementDefaultValidImmediate(XSTypeDefinition type, String value, ValidationContext context, ValidatedInfo vinfo)

check whether a value is a valid default for some type returns the compiled form of the value The parameter value could be either a String or a ValidatedInfo object

findElemInTableback to summary
public static void findElemInTable(XSComplexTypeDecl type, XSElementDecl elem, SymbolHash elemDeclHash) throws XMLSchemaException
fullSchemaCheckingback to summary
public static void fullSchemaChecking(XSGrammarBucket grammarBucket, SubstitutionGroupHandler SGHandler, CMBuilder cmBuilder, XMLErrorReporter errorReporter)

used to check the 3 constraints against each complex type (should be each model group): Unique Particle Attribution, Particle Derivation (Restriction), Element Declrations Consistent.

gatherChildrenback to summary
private static void gatherChildren(int parentType, XSParticleDecl p, List<XSParticleDecl> children)
getEmptySequenceback to summary
public static XSParticleDecl getEmptySequence()
getNonUnaryGroupback to summary
private static XSParticleDecl getNonUnaryGroup(XSParticleDecl p)
overlapUPAback to summary
public static boolean overlapUPA(XSElementDecl element1, XSElementDecl element2, SubstitutionGroupHandler sgHandler)
overlapUPAback to summary
public static boolean overlapUPA(XSElementDecl element, XSWildcardDecl wildcard, SubstitutionGroupHandler sgHandler)
overlapUPAback to summary
public static boolean overlapUPA(XSWildcardDecl wildcard1, XSWildcardDecl wildcard2)
overlapUPAback to summary
public static boolean overlapUPA(Object decl1, Object decl2, SubstitutionGroupHandler sgHandler)
particleValidRestrictionback to summary
private static boolean particleValidRestriction(XSParticleDecl dParticle, SubstitutionGroupHandler dSGHandler, XSParticleDecl bParticle, SubstitutionGroupHandler bSGHandler) throws XMLSchemaException
particleValidRestrictionback to summary
private static boolean particleValidRestriction(XSParticleDecl dParticle, SubstitutionGroupHandler dSGHandler, XSParticleDecl bParticle, SubstitutionGroupHandler bSGHandler, boolean checkWCOccurrence) throws XMLSchemaException
removePointlessChildrenback to summary
private static List<XSParticleDecl> removePointlessChildren(XSParticleDecl p)
reportSchemaErrorback to summary
pack-priv static void reportSchemaError(XMLErrorReporter errorReporter, SimpleLocator loc, String key, Object[] args)