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/binding/org/apache/xmlbeans/impl/binding/tylar DefaultTylarLoader.java
Date Sun, 30 May 2004 04:35:25 GMT
pcal        2004/05/29 21:35:25

  Modified:    v2/jam/src/org/apache/xmlbeans/impl/jam/annotation
                        JavadocTagParser.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements
                        AnnotatedElementImpl.java
               v2/src/binding/org/apache/xmlbeans/impl/binding/tylar
                        DefaultTylarLoader.java
  Log:
  jam and tylar tweaks
  
  Revision  Changes    Path
  1.2       +6 -7      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/annotation/JavadocTagParser.java
  
  Index: JavadocTagParser.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/annotation/JavadocTagParser.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JavadocTagParser.java	28 May 2004 17:02:51 -0000	1.1
  +++ JavadocTagParser.java	30 May 2004 04:35:25 -0000	1.2
  @@ -66,14 +66,11 @@
       if (current == null) {
         current = target.findOrCreateAnnotation(tagName);
         setPosition(current,tag);
  -      //setSingleValueText(current,tag);
  -      return new MAnnotation[] {current};
  -    } else {
  -      MAnnotation literal = target.addLiteralAnnotation(tagName);
  -      setPosition(literal,tag);
  -//    setSingleValueText(literal,tag);
  -      return new MAnnotation[] {literal,current};
       }
  +    MAnnotation literal = target.addLiteralAnnotation(tagName);
  +    setPosition(literal,tag);
  +//    setSingleValueText(literal,tag);
  +    return new MAnnotation[] {literal,current};
     }
   
   
  @@ -82,6 +79,8 @@
     protected void setValue(MAnnotation[] anns,
                             String memberName,
                             String value) {
  +    value = value.trim();
  +    memberName = memberName.trim();
       for(int i=0; i<anns.length; i++) {
         if (anns[i].getValue(memberName) == null) {
           // first one wins
  
  
  
  1.18      +8 -7      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements/AnnotatedElementImpl.java
  
  Index: AnnotatedElementImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements/AnnotatedElementImpl.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- AnnotatedElementImpl.java	28 May 2004 17:02:51 -0000	1.17
  +++ AnnotatedElementImpl.java	30 May 2004 04:35:25 -0000	1.18
  @@ -134,23 +134,23 @@
       AnnotationProxy proxy = getContext().
         createAnnotationProxy(annotationName);
       ann = new AnnotationImpl(getContext(),proxy,annotationName);
  -    addAnnotation(ann);
  +    if (mName2Annotation == null) {
  +      mName2Annotation = new HashMap();
  +    }
  +    mName2Annotation.put(ann.getSimpleName(),ann);
       return ann;
     }
   
     public MAnnotation addLiteralAnnotation(String annName) {
       if (annName == null) throw new IllegalArgumentException("null tagname");
       annName = annName.trim();
  -    // if one doesn't exist yet, then create the first one
  -    if (getMutableAnnotation(annName) == null) {
  -      return findOrCreateAnnotation(annName);
  -    }
       // otherwise, we have to create an 'extra' one.  note this will only
       // happen when processing javadoc tags where more than one tag of a given
       // name appears in a given scope
       AnnotationProxy proxy = getContext().createAnnotationProxy(annName);
       MAnnotation ann = new AnnotationImpl(getContext(),proxy,annName);
  -    addAnnotation(ann);
  +    if (mAllAnnotations == null) mAllAnnotations = new ArrayList();
  +    mAllAnnotations.add(ann);
       return ann;
     }
   
  @@ -170,7 +170,6 @@
         mName2Annotation = new HashMap();
         mName2Annotation.put(ann.getSimpleName(),ann);
       } else {
  -      // first one in wins
         if (mName2Annotation.get(ann.getSimpleName()) == null) {
           mName2Annotation.put(ann.getSimpleName(),ann);
         }
  @@ -194,6 +193,8 @@
       MAnnotation ann = findOrCreateAnnotation(tagName);
       JClass type = getClassLoader().loadClass("java.lang.String");
       ann.setSimpleValue(JAnnotation.SINGLE_VALUE_NAME,value,type);
  +    MAnnotation litann = addLiteralAnnotation(tagName);
  +    litann.setSimpleValue(JAnnotation.SINGLE_VALUE_NAME,value,type);
       return ann;
     }
   
  
  
  
  1.20      +27 -1     xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/DefaultTylarLoader.java
  
  Index: DefaultTylarLoader.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/tylar/DefaultTylarLoader.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- DefaultTylarLoader.java	28 May 2004 22:46:40 -0000	1.19
  +++ DefaultTylarLoader.java	30 May 2004 04:35:25 -0000	1.20
  @@ -106,7 +106,32 @@
   
     private static final String STS_PREFIX = "schema"+SEPCHAR+"system"+SEPCHAR;
   
  +  /**
  +   * Loads the tylar from the given uri.
  +   *
  +   * @param uri uri of where the tylar is stored.
  +   * @return
  +   * @throws IOException if an i/o error occurs while processing
  +   * @throws XmlException if an error occurs parsing the contents of the tylar.
  +   */
  +  /*
  +  public Tylar load(URI uri) throws IOException, XmlException
  +  {
  +    return load(new URL[]{new URL(uri.toString())});
  +  }
   
  +  public Tylar load(URI[] uris) throws IOException, XmlException {
  +    URL[] urls = new URL[uris.length];
  +    for(int i=0; i<uris.length; i++) {
  +      urls[i] = new URL(uris[i].toString());
  +    }
  +    return load(urls);
  +  }
  +
  +  public Tylar load(JarInputStream jar) throws IOException, XmlException {
  +    if (jar == null) throw new IllegalArgumentException("null stream");
  +    return loadFromJar(jar,null);
  +  } */
     /**
      * Loads the tylar from the given uri.
      *
  @@ -221,7 +246,8 @@
           }
         }
       }
  -    return new TylarImpl(new URL[]{source.toURL()},bf,schemas,sts);
  +    return new TylarImpl((source == null) ? null : new URL[]{source.toURL()},
  +                         bf,schemas,sts);
     }
     // ========================================================================
     // Private methods
  
  
  

---------------------------------------------------------------------
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