Author: mukulg
Date: Sun Feb 13 06:44:38 2011
New Revision: 1070188

URL: http://svn.apache.org/viewvc?rev=1070188&view=rev
Log:
doing little refactoring (class renaming etc) - no functional changes in this 
commit.

Added:
    
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AbstractPsychoPathXPath2Impl.java
      - copied, changed from r1070000, 
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/XMLAssertPsychopathXPath2Impl.java
      - copied, changed from r1070181, 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathImpl.java
Removed:
    
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
Modified:
    
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDAssertionValidator.java
    
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java
    
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XMLAssertAdapter.java
    
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertImpl.java

Copied: 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AbstractPsychoPathXPath2Impl.java
 (from r1070000, 
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/AbstractPsychoPathXPath2Impl.java?p2=xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AbstractPsychoPathXPath2Impl.java&p1=xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AbstractPsychoPathImpl.java&r1=1070000&r2=1070188&rev=1070188&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/AbstractPsychoPathXPath2Impl.java
 Sun Feb 13 06:44:38 2011
@@ -49,15 +49,14 @@ import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
 /**
- * A base class providing common services for XPath expression evaluation, 
with 
- * 'PsychoPath XPath 2.0' engine.
+ * A base class providing common services for XPath expression evaluation, 
with 'PsychoPath XPath 2.0' engine.
  * 
  * @xerces.internal
  * 
  * @author Mukul Gandhi, IBM
  * @version $Id$
  */
-public class AbstractPsychoPathImpl {
+public class AbstractPsychoPathXPath2Impl {
     
     private DynamicContext fXpath2DynamicContext = null;
     private Document domDoc = null;
@@ -134,9 +133,10 @@ public class AbstractPsychoPathImpl {
     
     
     /*
-     * Compile an XPath string, and return the compiled XPath expression.
+     * Compile an XPath string and return the compiled XPath expression.
      */
     protected XPath compileXPathStr(String xpathStr, XSAssertImpl assertImpl, 
XSDHandler fSchemaHandler) {        
+        
         XPathParser xpp = new JFlexCupParser();
         XPath xp = null;
         
@@ -156,6 +156,7 @@ public class AbstractPsychoPathImpl {
      * Method to report error messages.
      */
     private void reportError(String key, XSAssertImpl assertImpl, XSDHandler 
fSchemaHandler) {
+        
         XSTypeDefinition typeDef = assertImpl.getTypeDefinition();
         String typeString = "";
         

Copied: 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java
 (from r1070181, 
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/XMLAssertPsychopathXPath2Impl.java?p2=xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathXPath2Impl.java&p1=xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLAssertPsychopathImpl.java&r1=1070181&r2=1070188&rev=1070188&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/XMLAssertPsychopathXPath2Impl.java
 Sun Feb 13 06:44:38 2011
@@ -80,12 +80,12 @@ import org.w3c.dom.NodeList;
  * 
  * @version $Id$
  */
-public class XMLAssertPsychopathImpl extends XMLAssertAdapter {
+public class XMLAssertPsychopathXPath2Impl extends XMLAssertAdapter {
 
     // class variable declarations
     private DynamicContext fXpath2DynamicContext;
     private XSModel fSchema = null;
-    private AbstractPsychoPathImpl fAbstrPsychopathImpl = null;
+    private AbstractPsychoPathXPath2Impl fAbstrPsychopathImpl = null;
 
     // the DOM root of assertions tree
     private Document fAssertDocument = null;
@@ -112,7 +112,7 @@ public class XMLAssertPsychopathImpl ext
     /*
      * Class constructor.
      */
-    public XMLAssertPsychopathImpl(Map assertParams) {        
+    public XMLAssertPsychopathXPath2Impl(Map assertParams) {        
         // initializing the class variables
         this.fAssertDocument = new PSVIDocumentImpl();        
         this.fAssertRootStack = new Stack();
@@ -126,7 +126,7 @@ public class XMLAssertPsychopathImpl ext
      */
     private void initXPathProcessor() throws Exception {        
         fValidator = (XMLSchemaValidator) 
getProperty("http://apache.org/xml/properties/assert/validator";);        
-        fAbstrPsychopathImpl = new AbstractPsychoPathImpl();
+        fAbstrPsychopathImpl = new AbstractPsychoPathXPath2Impl();
         fXpath2DynamicContext = 
fAbstrPsychopathImpl.initDynamicContext(fSchema, fAssertDocument, 
fAssertParams);        
     } // initXPathProcessor
     
@@ -829,12 +829,12 @@ public class XMLAssertPsychopathImpl ext
         String value = assertError.getValue();
         
         XSTypeDefinition typeDef = assertImpl.getTypeDefinition();        
-        String typeString = "";        
+        String typeNameStrAnnotation = "";        
         if (typeDef != null) {
-            typeString = (typeDef.getName() != null) ? typeDef.getName() : 
"#anonymous";   
+            typeNameStrAnnotation = (typeDef.getName() != null) ? 
typeDef.getName() : "#anonymous";   
         }
         else {
-            typeString = "#anonymous"; 
+            typeNameStrAnnotation = "#anonymous"; 
         }
         
         String elemErrorAnnotation = element.rawname;
@@ -845,10 +845,10 @@ public class XMLAssertPsychopathImpl ext
         String listAssertErrMessage = "";        
         if (isList) {
            if (assertError.getIsTypeDerivedFromList()) {
-              listAssertErrMessage =  "Assertion failed for xs:list instance 
'" + assertError.getValue() + "'.";  
+               listAssertErrMessage =  "Assertion failed for xs:list instance 
'" + assertError.getValue() + "'.";  
            }
            else {
-              listAssertErrMessage =  "Assertion failed for an xs:list member 
value '" + assertError.getValue() + "'.";
+               listAssertErrMessage =  "Assertion failed for an xs:list member 
value '" + assertError.getValue() + "'.";
            }
         }
             
@@ -863,15 +863,15 @@ public class XMLAssertPsychopathImpl ext
                message = message + ".";    
            }
            if (key.equals("cvc-assertion.4.3.15.3")) {
-               message = "Assertion failed (undefined context) for schema type 
'" + typeString + "'. " + message;   
+               message = "Assertion failed (undefined context) for schema type 
'" + typeNameStrAnnotation + "'. " + message;   
            }
            else {
-               message = "Assertion failed for schema type '" + typeString + 
"'. " + message; 
+               message = "Assertion failed for schema type '" + 
typeNameStrAnnotation + "'. " + message; 
            }           
            fValidator.reportSchemaError("cvc-assertion.failure", new Object[] 
{message, listAssertErrMessage});    
         }
         else {
-           fValidator.reportSchemaError(key, new Object[] 
{elemErrorAnnotation, assertImpl.getTest().getXPath().toString(), typeString, 
listAssertErrMessage});
+           fValidator.reportSchemaError(key, new Object[] 
{elemErrorAnnotation, assertImpl.getTest().getXPath().toString(), 
typeNameStrAnnotation, listAssertErrMessage});
         }
         
     } // reportAssertionsError

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=1070188&r1=1070187&r2=1070188&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
 Sun Feb 13 06:44:38 2011
@@ -378,7 +378,7 @@ public class XSDAssertionValidator {
         if (assertProcessorProp == null || assertProcessorProp.length() == 0) {
             // if assertion processor is not specified via a system property, 
initialize it to the
             // "PsychoPath XPath 2.0" processor.
-            fAssertionProcessor = new XMLAssertPsychopathImpl(assertParams);
+            fAssertionProcessor = new 
XMLAssertPsychopathXPath2Impl(assertParams);
         } 
         else {
             try {

Modified: 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java?rev=1070188&r1=1070187&r2=1070188&view=diff
==============================================================================
--- 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java
 (original)
+++ 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java
 Sun Feb 13 06:44:38 2011
@@ -23,7 +23,7 @@ import java.util.Map;
 import org.apache.xerces.dom.PSVIAttrNSImpl;
 import org.apache.xerces.dom.PSVIDocumentImpl;
 import org.apache.xerces.impl.xpath.XPath20;
-import org.apache.xerces.impl.xs.AbstractPsychoPathImpl;
+import org.apache.xerces.impl.xs.AbstractPsychoPathXPath2Impl;
 import org.apache.xerces.util.NamespaceSupport;
 import org.apache.xerces.xni.QName;
 import org.apache.xerces.xni.XMLAttributes;
@@ -43,7 +43,7 @@ import org.w3c.dom.Element;
  * @author Mukul Gandhi IBM
  * @version $Id$
  */
-public class Test extends AbstractPsychoPathImpl {
+public class Test extends AbstractPsychoPathXPath2Impl {
 
        /** The type alternative to which the test belongs */
     protected final XSTypeAlternativeImpl fTypeAlternative;

Modified: 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XMLAssertAdapter.java
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XMLAssertAdapter.java?rev=1070188&r1=1070187&r2=1070188&view=diff
==============================================================================
--- 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XMLAssertAdapter.java
 (original)
+++ 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XMLAssertAdapter.java
 Sun Feb 13 06:44:38 2011
@@ -26,7 +26,7 @@ import org.apache.xerces.xni.XMLString;
 
 /**
  * A convenience implementation of the assertions interface. All compliant 
assertions
- * processors (using a specific XPath 2.0 engine), should extend this class.
+ * processors (using a specific XPath 2.0 engine) should extend this class.
  * 
  * @xerces.internal
  * 
@@ -35,12 +35,10 @@ import org.apache.xerces.xni.XMLString;
  */
 public class XMLAssertAdapter implements XMLAssertHandler {
     
-    // this hashtable contains any implementation specific
-    // properties
+    // this hashtable contains any implementation specific properties
     private Hashtable properties = null;
 
-    public void startElement(QName element, XMLAttributes attributes,
-                                            Augmentations augs) {
+    public void startElement(QName element, XMLAttributes attributes, 
Augmentations augs) {
         // TODO Auto-generated method stub
 
     }
@@ -56,13 +54,11 @@ public class XMLAssertAdapter implements
     }
     
     /**
-     * Allows the user to set specific properties on the underlying 
-     * implementation.
+     * Allows the user to set specific properties on the underlying 
implementation.
      * @param name    name of property
      * @param value   null means to remove property
      */
-    public void setProperty(String name, Object value)
-                     throws IllegalArgumentException {
+    public void setProperty(String name, Object value) throws 
IllegalArgumentException {
         // this handles removal of properties
         if (value == null) {
           if (properties != null) {

Modified: 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertImpl.java
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertImpl.java?rev=1070188&r1=1070187&r2=1070188&view=diff
==============================================================================
--- 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertImpl.java
 (original)
+++ 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/assertion/XSAssertImpl.java
 Sun Feb 13 06:44:38 2011
@@ -17,7 +17,7 @@
 
 package org.apache.xerces.impl.xs.assertion;
 
-import org.apache.xerces.impl.xs.AbstractPsychoPathImpl;
+import org.apache.xerces.impl.xs.AbstractPsychoPathXPath2Impl;
 import org.apache.xerces.impl.xs.traversers.XSDHandler;
 import org.apache.xerces.impl.xs.util.XSTypeHelper;
 import org.apache.xerces.util.NamespaceSupport;
@@ -35,7 +35,7 @@ import org.eclipse.wst.xml.xpath2.proces
  * @author Mukul Gandhi, IBM
  * @version $Id$
  */
-public class XSAssertImpl extends AbstractPsychoPathImpl implements XSAssert {
+public class XSAssertImpl extends AbstractPsychoPathXPath2Impl implements 
XSAssert {
 
     // The kind of assertion this is
     private short fAssertKind = XSConstants.ASSERTION;



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to