xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject cvs commit: xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/internal BaseJAnnotation.java
Date Fri, 13 Feb 2004 21:38:34 GMT
pcal        2004/02/13 13:38:34

  Modified:    v2/src/jam/org/apache/xmlbeans/impl/jam JAnnotation.java
                        JAnnotationMember.java
               v2/src/jam/org/apache/xmlbeans/impl/jam/editable
                        EAnnotationDefinition.java
                        EAnnotationMemberDefinition.java
               v2/src/jam/org/apache/xmlbeans/impl/jam/internal
                        BaseJAnnotation.java
  Added:       v2/src/jam/org/apache/xmlbeans/impl/jam
                        JAnnotationDefinition.java
                        JAnnotationMemberDefinition.java
  Removed:     v2/src/jam/org/apache/xmlbeans/impl/jam
                        JAnnotationDeclaration.java
                        JAnnotationMemberDeclaration.java
  Log:
  jam: more 175 tweaks, rename declaration to 'definition'
  
  Revision  Changes    Path
  1.7       +29 -40    xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JAnnotation.java
  
  Index: JAnnotation.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JAnnotation.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JAnnotation.java	13 Feb 2004 19:22:31 -0000	1.6
  +++ JAnnotation.java	13 Feb 2004 21:38:33 -0000	1.7
  @@ -31,6 +31,14 @@
    */
   public interface JAnnotation extends JElement {
   
  +  // ========================================================================
  +  // Constants
  +
  +  public static final String SINGLE_MEMBER_NAME = "value";
  +
  +  // ========================================================================
  +  // Public methods
  +
     /**
      * Returns the name of this annotation.  Note that in the case of
      * javadoc-style annotations, this name will NOT include the leading
  @@ -40,47 +48,12 @@
      * getDeclaration().getSimpleName();  it really is type information,
      * which I thought we didn't want to expose here.  However,
      * I think name is still needed here simply because we may not always
  -   * have a declaration (i.e. in the javadoc case), but we will still
  +   * have a definition (i.e. in the javadoc case), but we will still
      * have a name.
      */
     public String getName();
   
     /**
  -   * <p>Returns the JAnnotationMember which represents the member of this
  -   * annotation if this annotation qualifies as a 'single member
  -   * annotation.'</p>
  -   *
  -   * <p>This method should not be used lightly, as it is here primarily to
  -   * provide support simple javadoc tags of the form '@mytag value'.  If you
  -   * are using tags of this form, you probably need to do some thinking
  -   * about how you want to map your tag system into 175 annotation types.
  -   * getSingleMember() provides one avenue for such a mapping by equating
  -   * such simple javadoc tags as JSR175 single member annotations.</p>
  -   *
  -   * <p>The qualifications for being a 'single member annotation' are as
  -   * follows:</p>
  -   * <ul>
  -   *   <li>For JSR175 tags, as described in the spec, the annotation must be
  -   *       of a type which either has only one member, or has multiple members
  -   *       but exactly one member which has no default value (which is
  -   *       considered the single member).</li>
  -   *   <li>All javadoc tags implicitly qualify as single member tags,
  -   *       although not all of them should be treated as such.  For simple
  -   *       javadoc tags (@mytag value), this method provides thoe only
  -   *       means of accessing the tag value.  However, if the tag contains
  -   *       complex content (typically expressed as name=value pairs), this
  -   *       method returns a member which contains the entire raw text of
  -   *       the tag, whitespace and '=' signs included.  Typically, this is not
  -   *       useful - you should call getMembers() or getMember("name") to get
  -   *       at the structured data.</li>
  -   * </ul>
  -   *
  -   * <p>If this annotation does not qualify as a single member annotation,
  -   * as described above, this method will return null.</p.
  -   */
  -  public JAnnotationMember getSingleMember();
  -
  -  /**
      * Returns an array containing this annotation's members.  Returns an
      * empty array if the annotation has no members.
      */
  @@ -88,25 +61,41 @@
   
     /**
      * Returns the member of this annotation which has the given name,
  -   * or null if no such member exists.
  +   * or null if no such member exists.  If this tag is a 175 tag,
  +   * you can call getMember(SINGLE_MEMBER_NAME) to get the single member
  +   * of a single-member annotation, as described in the 175 specification.
  +   * If this tag is a javadoc tag, getMember(SINGLE_MEMBER_NAME) returns
  +   * the lone member of a simple javadoc tag (i.e., one of the form
  +   * '@mytag myvalue').
      *
  -   * @return The named member or null.
  +   * @return The named member or null if none exists.
      * @throws IllegalArgumentException if the parameter is null.
      */
     public JAnnotationMember getMember(String named);
   
     /**
  -   * Returns a representation of this annotation's type declaration.  This
  +   * Returns a representation of this annotation's type definition.  This
      * typically returns null if the Annotation is does not represent a
      * JSR175 annotation.
      */
  -  public JAnnotationDeclaration getDeclaration();
  +  public JAnnotationDefinition getDefinition();
   
     /**
      * <p>If this JAnnotation represents a JSR175 annotation, returns the
      * underlying java.lang.Annotation instance.  Returns null otherwise.</p>
      */
     public Object getAnnotationObject();
  +
  +  /**
  +   * <p>If this JAnnotation represents a javadoc tag, returns the raw,
  +   * untrimmed contents of the tag.  Otherwise, returns null.  You
  +   * shouldn't use this method without a really good reason - you normally
  +   * should call one of the getMember() methods to get at the tag contents.
  +   * You can call getMember(SINGLE_MEMBER_NAME) to get a JAnnotationMember
  +   * representing the contents of a simple javadoc tag (e.g. @mytag myvalue).
  +   * </p>
  +   */
  +  public String getJavadocText();
   
   
     // ========================================================================
  
  
  
  1.7       +4 -4      xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JAnnotationMember.java
  
  Index: JAnnotationMember.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JAnnotationMember.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JAnnotationMember.java	13 Feb 2004 19:22:31 -0000	1.6
  +++ JAnnotationMember.java	13 Feb 2004 21:38:33 -0000	1.7
  @@ -35,7 +35,7 @@
   
     /**
      * <p>Returns true if the member's value was not explicitly set in the
  -   * annotation instance but was instead taken from the member declaration
  +   * annotation instance but was instead taken from the member definition's
      * default.</p>
      *
      * <p>Note that not all JAM implementations may be able to distinguish
  @@ -49,11 +49,11 @@
     public boolean isDefaultValueUsed();
   
     /**
  -   * <p>Returns the a representation of the declaration of this member in its
  -   * annotation type declaration.  This will typically return null if
  +   * <p>Returns the a representation of the definition of this member in its
  +   * annotation type definition.  This will typically return null if
      * the AnnotationMember is not not part of a JSR175 annotation.</p>
      */
  -  public JAnnotationMemberDeclaration getMemberDeclaration();
  +  public JAnnotationMemberDefinition getMemberDefinition();
   
     /**
      * <p>If this member is complex (i.e. an instance of another annotation
  
  
  
  1.3       +18 -56    xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JAnnotationDefinition.java
  
  
  
  
  1.3       +17 -55    xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JAnnotationMemberDefinition.java
  
  
  
  
  1.4       +2 -2      xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/editable/EAnnotationDefinition.java
  
  Index: EAnnotationDefinition.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/editable/EAnnotationDefinition.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EAnnotationDefinition.java	12 Feb 2004 20:06:10 -0000	1.3
  +++ EAnnotationDefinition.java	13 Feb 2004 21:38:34 -0000	1.4
  @@ -15,7 +15,7 @@
   
   package org.apache.xmlbeans.impl.jam.editable;
   
  -import org.apache.xmlbeans.impl.jam.JAnnotationDeclaration;
  +import org.apache.xmlbeans.impl.jam.JAnnotationDefinition;
   import org.apache.xmlbeans.impl.jam.JClass;
   
   /**
  @@ -23,7 +23,7 @@
    * @author Patrick Calahan <pcal@bea.com>
    */
   public interface EAnnotationDefinition extends
  -        JAnnotationDeclaration, EElement {
  +        JAnnotationDefinition, EElement {
   
     /**
      * Creates a new member in this Annotation definition and returns the
  
  
  
  1.4       +2 -2      xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/editable/EAnnotationMemberDefinition.java
  
  Index: EAnnotationMemberDefinition.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/editable/EAnnotationMemberDefinition.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EAnnotationMemberDefinition.java	12 Feb 2004 20:06:10 -0000	1.3
  +++ EAnnotationMemberDefinition.java	13 Feb 2004 21:38:34 -0000	1.4
  @@ -15,14 +15,14 @@
   
   package org.apache.xmlbeans.impl.jam.editable;
   
  -import org.apache.xmlbeans.impl.jam.JAnnotationMemberDeclaration;
  +import org.apache.xmlbeans.impl.jam.JAnnotationMemberDefinition;
   
   /**
    *
    * @author Patrick Calahan <pcal@bea.com>
    */
   public interface EAnnotationMemberDefinition
  -        extends JAnnotationMemberDeclaration, EElement {
  +        extends JAnnotationMemberDefinition, EElement {
   
   
   }
  
  
  
  1.11      +7 -7      xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/internal/BaseJAnnotation.java
  
  Index: BaseJAnnotation.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/internal/BaseJAnnotation.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- BaseJAnnotation.java	13 Feb 2004 19:22:31 -0000	1.10
  +++ BaseJAnnotation.java	13 Feb 2004 21:38:34 -0000	1.11
  @@ -21,7 +21,7 @@
   import org.apache.xmlbeans.impl.jam.*;
   
   /**
  - * Javadoc-backed implementation of org.apache.xmlbeans.impl.jam.Annotation
  + * Base implementation of org.apache.xmlbeans.impl.jam.Annotation
    *
    * @author Patrick Calahan <pcal@bea.com>
    */
  @@ -110,7 +110,7 @@
       return null;
     }
   
  -  public JAnnotationDeclaration getDeclaration() {
  +  public JAnnotationDefinition getDefinition() {
       return null;
     }
   
  @@ -118,6 +118,10 @@
       return null;
     }
   
  +  public String getJavadocText() {
  +    return null;
  +  }
  +
     public JSourcePosition getSourcePosition() {
       return mSourcePosition;
     }
  @@ -179,14 +183,10 @@
       }
     }
   
  -  public JAnnotationMember getSingleMember() {
  -    return this;
  -  }
  -
     // ========================================================================
     // JAnnotationMember implementation
   
  -  public JAnnotationMemberDeclaration getMemberDeclaration() {
  +  public JAnnotationMemberDefinition getMemberDefinition() {
       return null;
     }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-cvs-help@xml.apache.org


Mime
View raw message