You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by el...@apache.org on 2002/01/28 20:46:34 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/xni/psvi ItemPSVI.java
elena 02/01/28 11:46:34
Modified: java/src/org/apache/xerces/impl/xs AttributePSVImpl.java
ElementPSVImpl.java
java/src/org/apache/xerces/parsers AbstractDOMParser.java
AbstractSAXParser.java
java/src/org/apache/xerces/util AugmentationsImpl.java
XMLAttributesImpl.java
java/src/org/apache/xerces/xni Augmentations.java
XMLAttributes.java
java/src/org/apache/xerces/xni/parser
XMLConfigurationException.java
java/src/org/apache/xerces/xni/psvi ItemPSVI.java
Log:
XNI updates:
1) xni/Augmentations: added
Enumeration keys() method that returns enumeration of keys in the Augmentations
2) xni/XMLAttributes: added
Augmentations getAugmentations(String qName) method
3) renamed some PSVI methods:
- schemaSpecified to isSpecified()
- added get* to some methods.
Minor fix: xni/parser/XMLConfigurationException
change constant value.
Revision Changes Path
1.4 +6 -7 xml-xerces/java/src/org/apache/xerces/impl/xs/AttributePSVImpl.java
Index: AttributePSVImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/AttributePSVImpl.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AttributePSVImpl.java 10 Jan 2002 06:34:22 -0000 1.3
+++ AttributePSVImpl.java 28 Jan 2002 19:46:33 -0000 1.4
@@ -143,7 +143,7 @@
* @return The canonical lexical representation of the declaration's {value constraint} value.
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_default>XML Schema Part 1: Structures [schema default]</a>
*/
- public String schemaDefault() {
+ public String getSchemaDefault() {
Object dValue = null;
if( fDeclaration !=null ) {
dValue = fDeclaration.fDefault;
@@ -158,17 +158,16 @@
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_normalized_value>XML Schema Part 1: Structures [schema normalized value]</a>
* @return the normalized value of this item after validation
*/
- public String schemaNormalizedValue() {
+ public String getSchemaNormalizedValue() {
return fNormalizedValue;
}
/**
- * [schema specified]
- *
- * @return if return is true - schema, otherwise - infoset
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_specified>XML Schema Part 1: Structures [schema specified]</a>
+ * [schema specified]
+ * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_specified">XML Schema Part 1: Structures [schema specified]</a>
+ * @return false value was specified in schema, true value comes from the infoset
*/
- public boolean schemaSpecified() {
+ public boolean isSpecified() {
return fSpecified;
}
1.8 +6 -7 xml-xerces/java/src/org/apache/xerces/impl/xs/ElementPSVImpl.java
Index: ElementPSVImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/ElementPSVImpl.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ElementPSVImpl.java 10 Jan 2002 06:34:22 -0000 1.7
+++ ElementPSVImpl.java 28 Jan 2002 19:46:33 -0000 1.8
@@ -155,7 +155,7 @@
* @return The canonical lexical representation of the declaration's {value constraint} value.
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_default>XML Schema Part 1: Structures [schema default]</a>
*/
- public String schemaDefault() {
+ public String getSchemaDefault() {
Object dValue = null;
if( fDeclaration !=null ) {
dValue = fDeclaration.fDefault;
@@ -170,17 +170,16 @@
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_normalized_value>XML Schema Part 1: Structures [schema normalized value]</a>
* @return the normalized value of this item after validation
*/
- public String schemaNormalizedValue() {
+ public String getSchemaNormalizedValue() {
return fNormalizedValue;
}
/**
- * [schema specified]
- *
- * @return if return is true - schema, otherwise - infoset
- * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_specified>XML Schema Part 1: Structures [schema specified]</a>
+ * [schema specified]
+ * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_specified">XML Schema Part 1: Structures [schema specified]</a>
+ * @return false value was specified in schema, true value comes from the infoset
*/
- public boolean schemaSpecified() {
+ public boolean isSpecified() {
return fSpecified;
}
1.33 +5 -5 xml-xerces/java/src/org/apache/xerces/parsers/AbstractDOMParser.java
Index: AbstractDOMParser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/AbstractDOMParser.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- AbstractDOMParser.java 28 Jan 2002 00:35:44 -0000 1.32
+++ AbstractDOMParser.java 28 Jan 2002 19:46:33 -0000 1.33
@@ -105,7 +105,7 @@
* @author Andy Clark, IBM
* @author Elena Litani, IBM
*
- * @version $Id: AbstractDOMParser.java,v 1.32 2002/01/28 00:35:44 elena Exp $
+ * @version $Id: AbstractDOMParser.java,v 1.33 2002/01/28 19:46:33 elena Exp $
*/
public abstract class AbstractDOMParser
extends AbstractXMLDocumentParser {
@@ -721,7 +721,7 @@
if (fNormalizeData) {
AttributePSVI attrPSVI = (AttributePSVI)attributes.getAugmentations(i).getItem(Constants.ATTRIBUTE_PSVI);
if (attrPSVI != null) {
- attrValue = attrPSVI.schemaNormalizedValue();
+ attrValue = attrPSVI.getSchemaNormalizedValue();
}
}
@@ -756,7 +756,7 @@
if (fNormalizeData) {
AttributePSVI attrPSVI = (AttributePSVI)attributes.getAugmentations(i).getItem(Constants.ATTRIBUTE_PSVI);
if (attrPSVI != null) {
- attrValue = attrPSVI.schemaNormalizedValue();
+ attrValue = attrPSVI.getSchemaNormalizedValue();
}
}
@@ -813,7 +813,7 @@
if (fNormalizeData && augs != null) {
ElementPSVI elemPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
if (elemPSVI != null) {
- value = elemPSVI.schemaNormalizedValue();
+ value = elemPSVI.getSchemaNormalizedValue();
}
}
if (value == null) {
@@ -864,7 +864,7 @@
if (fNormalizeData && augs != null) {
ElementPSVI elemPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
if (elemPSVI != null) {
- value = elemPSVI.schemaNormalizedValue();
+ value = elemPSVI.getSchemaNormalizedValue();
}
}
1.19 +3 -3 xml-xerces/java/src/org/apache/xerces/parsers/AbstractSAXParser.java
Index: AbstractSAXParser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/AbstractSAXParser.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- AbstractSAXParser.java 28 Jan 2002 19:33:35 -0000 1.18
+++ AbstractSAXParser.java 28 Jan 2002 19:46:33 -0000 1.19
@@ -112,7 +112,7 @@
* @author Arnaud Le Hors, IBM
* @author Andy Clark, IBM
*
- * @version $Id: AbstractSAXParser.java,v 1.18 2002/01/28 19:33:35 lehors Exp $
+ * @version $Id: AbstractSAXParser.java,v 1.19 2002/01/28 19:46:33 elena Exp $
*/
public abstract class AbstractSAXParser
extends AbstractXMLDocumentParser
@@ -416,7 +416,7 @@
if (fNormalizeData) {
AttributePSVI attrPSVI = (AttributePSVI)attributes.getAugmentations(i).getItem(Constants.ATTRIBUTE_PSVI);
if (attrPSVI != null) {
- attributes.setValue(i, attrPSVI.schemaNormalizedValue());
+ attributes.setValue(i, attrPSVI.getSchemaNormalizedValue());
}
}
@@ -485,7 +485,7 @@
if (fNormalizeData && augs != null) {
ElementPSVI elemPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
if (elemPSVI != null) {
- value = elemPSVI.schemaNormalizedValue();
+ value = elemPSVI.getSchemaNormalizedValue();
}
}
1.3 +9 -0 xml-xerces/java/src/org/apache/xerces/util/AugmentationsImpl.java
Index: AugmentationsImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/util/AugmentationsImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AugmentationsImpl.java 12 Dec 2001 22:33:47 -0000 1.2
+++ AugmentationsImpl.java 28 Jan 2002 19:46:33 -0000 1.3
@@ -58,6 +58,7 @@
package org.apache.xerces.util;
import java.util.Hashtable;
+import java.util.Enumeration;
import org.apache.xerces.xni.Augmentations;
@@ -110,6 +111,14 @@
*/
public Object removeItem (String key){
return fAugmentations.remove(key);
+ }
+
+ /**
+ * Returns an enumeration of the keys in the Augmentations structure
+ *
+ */
+ public Enumeration keys (){
+ return fAugmentations.keys();
}
/**
1.13 +18 -5 xml-xerces/java/src/org/apache/xerces/util/XMLAttributesImpl.java
Index: XMLAttributesImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/util/XMLAttributesImpl.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- XMLAttributesImpl.java 10 Jan 2002 06:34:23 -0000 1.12
+++ XMLAttributesImpl.java 28 Jan 2002 19:46:33 -0000 1.13
@@ -81,7 +81,7 @@
* @author Andy Clark, IBM
* @author Elena Litani, IBM
*
- * @version $Id: XMLAttributesImpl.java,v 1.12 2002/01/10 06:34:23 twl Exp $
+ * @version $Id: XMLAttributesImpl.java,v 1.13 2002/01/28 19:46:33 elena Exp $
*/
public class XMLAttributesImpl
implements XMLAttributes, AttributeList, Attributes {
@@ -627,11 +627,24 @@
public Augmentations getAugmentations (String uri, String localName) {
int index = getIndex(uri, localName);
- if (index < 0 || index >= fLength) {
- return null;
- }
- return fAugmentations[index];
+ return index != -1 ? fAugmentations[index] : null;
}
+
+ /**
+ * Look up an augmentation by XML 1.0 qualified name.
+ * <p>
+ *
+ * @param qName The XML 1.0 qualified name.
+ *
+ * @return Augmentations
+ *
+ */
+ public Augmentations getAugmentations(String qName){
+ int index = getIndex(qName);
+ return index != -1 ? fAugmentations[index] : null;
+ }
+
+
/**
* Look up an augmentations by attributes index.
1.3 +10 -4 xml-xerces/java/src/org/apache/xerces/xni/Augmentations.java
Index: Augmentations.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Augmentations.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Augmentations.java 12 Dec 2001 22:33:47 -0000 1.2
+++ Augmentations.java 28 Jan 2002 19:46:33 -0000 1.3
@@ -57,6 +57,8 @@
package org.apache.xerces.xni;
+import java.util.Enumeration;
+
/**
* The Augmentations interface defines a table of additional data that may
* be passed along the document pipeline. The information can contain extra
@@ -107,13 +109,17 @@
*/
public Object removeItem (String key);
+
+ /**
+ * Returns an enumeration of the keys in the Augmentations structure
+ *
+ */
+ public Enumeration keys ();
+
+
/**
* Remove all objects from the Augmentations structure.
*/
public void clear ();
- //
- // REVISIT:
- // provide a way to iterate through all of the items in the augmentations.
- //
}
1.7 +21 -6 xml-xerces/java/src/org/apache/xerces/xni/XMLAttributes.java
Index: XMLAttributes.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/XMLAttributes.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XMLAttributes.java 5 Dec 2001 22:59:28 -0000 1.6
+++ XMLAttributes.java 28 Jan 2002 19:46:33 -0000 1.7
@@ -71,7 +71,7 @@
*
* @author Andy Clark, IBM
*
- * @version $Id: XMLAttributes.java,v 1.6 2001/12/05 22:59:28 elena Exp $
+ * @version $Id: XMLAttributes.java,v 1.7 2002/01/28 19:46:33 elena Exp $
*/
public interface XMLAttributes {
@@ -385,8 +385,17 @@
*/
public boolean isSpecified(int attrIndex);
+
+ /**
+ * Look up an augmentation by attribute's index.
+ *
+ * @param attributeIndex The attribute index.
+ * @return Augmentations
+ */
+ public Augmentations getAugmentations (int attributeIndex);
+
/**
- * Look up an augmentations by attributes namespace name.
+ * Look up an augmentation by namespace name.
*
* @param uri The Namespace URI, or the empty string if
* the name has no Namespace URI.
@@ -395,12 +404,18 @@
*/
public Augmentations getAugmentations (String uri, String localPart);
+
/**
- * Look up an augmentations by attributes index.
- *
- * @param attributeIndex The attribute index.
+ * Look up an augmentation by XML 1.0 qualified name.
+ * <p>
+ *
+ * @param qName The XML 1.0 qualified name.
+ *
* @return Augmentations
+ *
*/
- public Augmentations getAugmentations (int attributeIndex);
+ public Augmentations getAugmentations(String qName);
+
+
} // interface XMLAttributes
1.3 +2 -2 xml-xerces/java/src/org/apache/xerces/xni/parser/XMLConfigurationException.java
Index: XMLConfigurationException.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/parser/XMLConfigurationException.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XMLConfigurationException.java 23 Aug 2001 00:35:37 -0000 1.2
+++ XMLConfigurationException.java 28 Jan 2002 19:46:33 -0000 1.3
@@ -66,7 +66,7 @@
*
* @author Andy Clark, IBM
*
- * @version $Id: XMLConfigurationException.java,v 1.2 2001/08/23 00:35:37 lehors Exp $
+ * @version $Id: XMLConfigurationException.java,v 1.3 2002/01/28 19:46:33 elena Exp $
*/
public class XMLConfigurationException
extends XNIException {
@@ -79,7 +79,7 @@
public static final short NOT_RECOGNIZED = 0;
/** Exception type: identifier not supported. */
- public static final short NOT_SUPPORTED = 0;
+ public static final short NOT_SUPPORTED = 1;
//
// Data
1.3 +4 -4 xml-xerces/java/src/org/apache/xerces/xni/psvi/ItemPSVI.java
Index: ItemPSVI.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/psvi/ItemPSVI.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ItemPSVI.java 10 Jan 2002 06:34:23 -0000 1.2
+++ ItemPSVI.java 28 Jan 2002 19:46:33 -0000 1.3
@@ -129,7 +129,7 @@
* @return The canonical lexical representation of the declaration's {value constraint} value.
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_default">XML Schema Part 1: Structures [schema default]</a>
*/
- public String schemaDefault();
+ public String getSchemaDefault();
/**
* [schema normalized value]
@@ -138,14 +138,14 @@
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_normalized_value">XML Schema Part 1: Structures [schema normalized value]</a>
* @return the normalized value of this item after validation
*/
- public String schemaNormalizedValue();
+ public String getSchemaNormalizedValue();
/**
* [schema specified]
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_specified">XML Schema Part 1: Structures [schema specified]</a>
- * @return true if return is schema, false if infoset
+ * @return false - value was specified in schema, true - value comes from the infoset
*/
- public boolean schemaSpecified();
+ public boolean isSpecified();
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org