You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@locus.apache.org on 2000/12/06 02:54:25 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/xni XMLAttributes.java

andyc       00/12/05 17:54:25

  Modified:    java/src/org/apache/xerces/xni Tag: xerces_j_2
                        XMLAttributes.java
  Log:
  Explicitly added prototypes for those methods shared by both
  the SAX Attributes and AttributeList interfaces. A bug in
  the Java compiler (javac) in 1.1.8 would issues uses of these
  methods via an XMLAttributes object as ambiguous. Adding the
  prototypes to the XMLAttributes interface works around the
  problem.
  
  The methods shared between the SAX interfaces are as follows:
    getLength():int, getType(int):String, getValue(int):String
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +68 -1     xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLAttributes.java
  
  Index: XMLAttributes.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLAttributes.java,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- XMLAttributes.java	2000/10/22 22:02:59	1.1.2.5
  +++ XMLAttributes.java	2000/12/06 01:54:25	1.1.2.6
  @@ -74,7 +74,7 @@
    *
    * @author Andy Clark, IBM
    *
  - * @version $Id: XMLAttributes.java,v 1.1.2.5 2000/10/22 22:02:59 andyc Exp $
  + * @version $Id: XMLAttributes.java,v 1.1.2.6 2000/12/06 01:54:25 andyc Exp $
    */
   public interface XMLAttributes
       extends AttributeList, Attributes {
  @@ -258,5 +258,72 @@
        * @param entityIndex The entity index.
        */
       public int getEntityLength(int attrIndex, int entityIndex);
  +
  +    //
  +    // Attributes and AttributeList methods
  +    //
  +
  +    // NOTE: The methods shared by both the SAX Attributes and
  +    //       AttributeList interfaces must be repeated in this
  +    //       interface due to a compiler bug in javac (JDK 1.1.8)
  +    //       that thinks that the XMLAttributes#getLength():int 
  +    //       method and other shared methods are ambiguous. 
  +    //       Simply including this method prototypes explicitly
  +    //       works around the problem. -Ac
  +
  +    /**
  +     * Returns the number of attributes in the list.
  +     * <p>
  +     * Once you know the number of attributes, you can iterate
  +     * through the list.
  +     *
  +     * @see #getURI(int)
  +     * @see #getLocalName(int)
  +     * @see #getQName(int)
  +     * @see #getType(int)
  +     * @see #getValue(int)
  +     */
  +    public int getLength();
  +
  +    /**
  +     * Look up an attribute's type by index.
  +     * <p>
  +     * The attribute type is one of the strings "CDATA", "ID",
  +     * "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES",
  +     * or "NOTATION" (always in upper case).
  +     * <p>
  +     * If the parser has not read a declaration for the attribute,
  +     * or if the parser does not report attribute types, then it must
  +     * return the value "CDATA" as stated in the XML 1.0 Recommentation
  +     * (clause 3.3.3, "Attribute-Value Normalization").
  +     * <p>
  +     * For an enumerated attribute that is not a notation, the
  +     * parser will report the type as "NMTOKEN".
  +     *
  +     * @param index The attribute index (zero-based).
  +     *
  +     * @return The attribute's type as a string, or null if the
  +     *         index is out of range.
  +     *
  +     * @see #getLength
  +     */
  +    public String getType(int index);
  +
  +    /**
  +     * Look up an attribute's value by index.
  +     * <p>
  +     * If the attribute value is a list of tokens (IDREFS,
  +     * ENTITIES, or NMTOKENS), the tokens will be concatenated
  +     * into a single string with each token separated by a
  +     * single space.
  +     *
  +     * @param index The attribute index (zero-based).
  +     *
  +     * @return The attribute's value as a string, or null if the
  +     *         index is out of range.
  +     *
  +     * @see #getLength
  +     */
  +    public String getValue(int index);
   
   } // interface XMLAttributes