You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mu...@apache.org on 2010/09/07 15:17:13 UTC
svn commit: r993343 - in
/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs:
AbstractPsychoPathImpl.java XMLAssertPsychopathImpl.java
XSDAssertionValidator.java
Author: mukulg
Date: Tue Sep 7 13:17:13 2010
New Revision: 993343
URL: http://svn.apache.org/viewvc?rev=993343&view=rev
Log:
improving few of javadocs comments
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AbstractPsychoPathImpl.java
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathImpl.java
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDAssertionValidator.java
Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AbstractPsychoPathImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AbstractPsychoPathImpl.java?rev=993343&r1=993342&r2=993343&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AbstractPsychoPathImpl.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AbstractPsychoPathImpl.java Tue Sep 7 13:17:13 2010
@@ -49,7 +49,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.Element;
/**
- * A base class providing common services for XPath 2 evaluation, with
+ * A base class providing common services for XPath 2.0 evaluation, with
* PsychoPath XPath 2.0 engine.
*
* @xerces.internal
@@ -73,7 +73,7 @@ public class AbstractPsychoPathImpl {
fDynamicContext = new DefaultDynamicContext(schema, document);
// populate the PsychoPath XPath 2.0 static context, with namespace
- // bindings derived from the XSD Schema document.
+ // bindings derived from the XML Schema document.
NamespaceSupport xpath2NamespaceContext = (NamespaceSupport)
psychoPathParams.get("XPATH2_NS_CONTEXT");
Enumeration currPrefixes = xpath2NamespaceContext.getAllPrefixes();
@@ -96,10 +96,10 @@ public class AbstractPsychoPathImpl {
* Evaluate XPath expression with PsychoPath engine.
*/
protected boolean evaluatePsychoPathExpr(XPath xp,
- String xPathDefaultNamespace,
- Element contextNode)
- throws StaticError, DynamicError,
- Exception {
+ String xPathDefaultNamespace,
+ Element contextNode)
+ throws StaticError, DynamicError,
+ Exception {
StaticChecker sc = new StaticNameResolver(fDynamicContext);
sc.check(xp);
@@ -168,7 +168,7 @@ public class AbstractPsychoPathImpl {
/*
- * Method to report error messages
+ * Method to report error messages.
*/
private void reportError(String key, XSAssertImpl assertImpl,
XSDHandler fSchemaHandler) {
Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathImpl.java?rev=993343&r1=993342&r2=993343&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathImpl.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathImpl.java Tue Sep 7 13:17:13 2010
@@ -65,9 +65,9 @@ import org.w3c.dom.NodeList;
* An implementation of the XPath interface, for XML Schema 1.1 'assertions'
* evaluation. This class interfaces with the PsychoPath XPath 2.0 engine.
*
- * This method constructs the PSVI enabled DOM trees for assertions evaluation,
+ * This class constructs the PSVI enabled DOM trees for assertions evaluation,
* from XNI event calls. The DOM trees constructed in this class, are mapped
- * by the PsychoPath XPath2 engine to an XPath2 XDM representation.
+ * by the PsychoPath XPath 2.0 engine to an XPath 2.0 XDM representation.
* XML Schema 1.1 assertions are evaluated on these tree instances, in a bottom
* up fashion.
*
@@ -253,8 +253,8 @@ public class XMLAssertPsychopathImpl ext
/*
* Method to evaluate all of assertions for an element tree. This is the
- * root method, which drives entire assertions evaluation within Xerces XML
- * Schema 1.1 implementation.
+ * root method, which evaluates all assertions within Xerces XML Schema 1.1
+ * implementation.
*/
private void processAllAssertionsOnElement(QName element,
XSSimpleTypeDefinition itemType,
@@ -331,7 +331,7 @@ public class XMLAssertPsychopathImpl ext
// complex type with complex content
// notes: $value should be, the XPath2 "empty sequence" ... TO DO
// user's are not expected to use XPath2 context variable $value
- // for complex contents, so it's harmless to leave this
+ // for schema complex contents, so it's harmless to leave this
// unimplemented as of now.
}
@@ -472,7 +472,7 @@ public class XMLAssertPsychopathImpl ext
// only 1 error message is reported for assertion failures on
// simpleType -> union, since it is hard (perhaps impossible?)
// to determine statically that what all assertions can cause
- // failure, when participating in an union.
+ // validation failure, when participating in an union.
if (isValidationFailedForUnion) {
fValidator.reportSchemaError("cvc-assertion.union.3.13.4.1",
new Object[] { element.rawname, value } );
@@ -568,8 +568,7 @@ public class XMLAssertPsychopathImpl ext
if (assertsSucceeded == assertFacets.size()) {
// all assertions on a 'union member type' have
// evaluated to 'true', therefore validation with
- // union has succeeded wrt assertions. return
- // a boolean value 'false' from this method.
+ // union has succeeded wrt assertions.
return false;
}
}
@@ -688,7 +687,7 @@ public class XMLAssertPsychopathImpl ext
/*
- * Assign a "XSD typed value" to the XPath2 "dynamic context" variable,
+ * Assign a "schema typed value" to the XPath2 "dynamic context" variable,
* $value.
*/
private void setValueOf$value(String value,
@@ -715,7 +714,8 @@ public class XMLAssertPsychopathImpl ext
XSComplexTypeDefinition cmplxTypeDef = (XSComplexTypeDefinition)
typeDef;
if (cmplxTypeDef.getSimpleType() != null) {
- xsdTypecode = getXSDTypeCodeOf$Value(cmplxTypeDef.getSimpleType());
+ xsdTypecode = getXSDTypeCodeOf$Value(cmplxTypeDef.
+ getSimpleType());
}
}
else {
@@ -742,12 +742,6 @@ public class XMLAssertPsychopathImpl ext
Find the built-in "XML Schema" Xerces 'type code' for XPath2 variable,
$value. This function recursively searches the XSD type hierarchy
navigating up the base types, to find the needed built-in type.
-
- The value of typeCode is retrieved from PsychoPath XPath2 engine, which
- returns a proper Xerces schema 'type code', or few of it's own crafted
- type (for few of XML schema 1.1 types) code values, which are again passed
- on to PsychoPath engine, to determine the right PsychoPath 'schema type'
- object representation.
*/
private short getXSDTypeCodeOf$Value(XSTypeDefinition elementType) {
@@ -832,7 +826,7 @@ public class XMLAssertPsychopathImpl ext
/*
- * Find the actual 'atomic type' of an 'list item' instance, if the
+ * Find the actual schema type of 'list item' instance, if the
* 'item type' of list has variety union.
*/
private XSSimpleTypeDefinition getActualListItemTypeForVarietyUnion
@@ -841,9 +835,8 @@ public class XMLAssertPsychopathImpl ext
XSSimpleTypeDefinition simpleTypeDefn = null;
- // Inspecting the member types of union in order, to see that which
- // schema type can successfully validate an atomic value first
- // (and this will be the result for us, from this method).
+ // Inspecting the member types of union in sequence, to find that which
+ // schema type can successfully validate an atomic value first.
for (int memTypeIdx = 0; memTypeIdx < memberTypes.getLength();
memTypeIdx++) {
XSSimpleType memSimpleType = (XSSimpleType) memberTypes.item
Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDAssertionValidator.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDAssertionValidator.java?rev=993343&r1=993342&r2=993343&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDAssertionValidator.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDAssertionValidator.java Tue Sep 7 13:17:13 2010
@@ -143,7 +143,7 @@ public class XSDAssertionValidator {
assertPSVI.fGrammars = grammarBucket.getGrammars();
// construct the augmentations object for assertions.
- // store assertPSVI into the augmentations
+ // store assertPSVI into the augmentations.
AugmentationsImpl assertAugs = new AugmentationsImpl();
assertAugs.putItem(Constants.ELEMENT_PSVI, assertPSVI);
assertAugs.putItem("ATOMIC_VALUE_VALIDITY", Boolean.valueOf
@@ -171,7 +171,7 @@ public class XSDAssertionValidator {
List assertionList = null;
if (typeDef.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
- // if element's governing type is a "complex type"
+ // if element's schema type is a "complex type"
XSObjectListImpl complexTypeAsserts = getAssertsFromComplexType(
typeDef, attributes);
if (complexTypeAsserts.size() > 0) {
@@ -179,7 +179,7 @@ public class XSDAssertionValidator {
}
}
else if (typeDef.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
- // if element's governing type is a "simple type"
+ // if element's schema type is a "simple type"
assertionList = getAssertsFromSimpleType(typeDef);
}
@@ -262,7 +262,7 @@ public class XSDAssertionValidator {
// restriction.
XSObjectList facets = attrType.getMultiValueFacets();
- // variety is 'unknown/absent' at the moment
+ // simpleType variety is 'unknown/absent' at the moment
short attrTypeVariety = XSSimpleTypeDefinition.VARIETY_ABSENT;
if (facets.getLength() == 0 && attrType.getItemType() != null) {
@@ -347,10 +347,6 @@ public class XSDAssertionValidator {
// Special handling for assertions on simpleType -> union
// cases. Adding an assertion here, for determining the
// NamespaceContext.
- // This particular assertion object is not actually evaluated.
- // For union types, assertions are later again determined
- // in XMLAssertPsychopathImpl, which are evaluated to determine
- // validity of an XML instance.
XSAssertImpl assertImpl = getFirstAssertFromUnionMemberTypes(
simpleTypeDef.getMemberTypes());
if (assertImpl != null) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org