Re: [castor-dev] Re: Annotation processing

2008-07-23 Thread Werner Guttmann
Bao,

can you please create a new Jira issue for this, and attach your patch
there ?

Thanks
Werner

Le Duc Bao wrote:
> Hello Joachim,
> 
> I attach a patch for the processing for XmlAttribute annotation by adding an
> indicator representing the existent of this annotation. Your feedbacks are
> warmly welcome.
> 
> Enjoys,
> Bao
> 
> On Sun, Jul 20, 2008 at 12:56 PM, Joachim Grüneis <[EMAIL PROTECTED]>
> wrote:
> 
>> Hello,
>>
>> I'm just back from vacation... so I haven't really taken a look onto
>> the problem...
>>
>> the focus of the current implementation was just onto what I needed to
>> un/marshal JAXB conform but I didn't care if there is enough
>> information to generate a schema from the Java sources
>>
>> can you please tell me (maybe as a patch) what information is needed
>> for you and I will bring it into the code base?
>>
>> I will have a look onto it during this week - as soon as I'm settled
>> again at home
>>
>> Have fun
>>
>> Joachim
>>
>> 2008/7/18 Le Duc Bao <[EMAIL PROTECTED]>:
>>> Hello Joachim,
>>>
>>> It seems being a problem with annotation processing because of there are
>> no
>>> indicator representing an annotation. For example
>>>
>>>  public class USPrice {
>>>  @XmlAttribute
>>>
>>>  public java.math.BigDecimal getPrice() {...} ;
>>>  public void setPrice(java.math.BigDecimal ) {...};
>>>  }
>>>
>>> So, the present of @XmlAttribute does not present in FieldInfo class so
>> that
>>> we can not distinguish the above case with the code below during
>> annotation
>>> processing:
>>>
>>>  public class USPrice {
>>>  public java.math.BigDecimal getPrice() {...} ;
>>>  public void setPrice(java.math.BigDecimal ) {...};
>>>  }
>>>
>>> JAXB specification considers those two cases different.
>>>
>>> At this time, this problem affects at least two annotations
>> XmlRootElement
>>> and XmlAttribute.
>>>
>>> Regards,
>>> Bao
>>>
>>
>> 
>>
>> -
>> To unsubscribe from this list, please visit:
>>
>> http://xircles.codehaus.org/manage_email

-
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email




[castor-dev] Re: Annotation processing

2008-07-22 Thread Le Duc Bao
Hello Joachim,

I attach a patch for the processing for XmlAttribute annotation by adding an
indicator representing the existent of this annotation. Your feedbacks are
warmly welcome.

Enjoys,
Bao

On Sun, Jul 20, 2008 at 12:56 PM, Joachim Grüneis <[EMAIL PROTECTED]>
wrote:

> Hello,
>
> I'm just back from vacation... so I haven't really taken a look onto
> the problem...
>
> the focus of the current implementation was just onto what I needed to
> un/marshal JAXB conform but I didn't care if there is enough
> information to generate a schema from the Java sources
>
> can you please tell me (maybe as a patch) what information is needed
> for you and I will bring it into the code base?
>
> I will have a look onto it during this week - as soon as I'm settled
> again at home
>
> Have fun
>
> Joachim
>
> 2008/7/18 Le Duc Bao <[EMAIL PROTECTED]>:
> > Hello Joachim,
> >
> > It seems being a problem with annotation processing because of there are
> no
> > indicator representing an annotation. For example
> >
> >  public class USPrice {
> >  @XmlAttribute
> >
> >  public java.math.BigDecimal getPrice() {...} ;
> >  public void setPrice(java.math.BigDecimal ) {...};
> >  }
> >
> > So, the present of @XmlAttribute does not present in FieldInfo class so
> that
> > we can not distinguish the above case with the code below during
> annotation
> > processing:
> >
> >  public class USPrice {
> >  public java.math.BigDecimal getPrice() {...} ;
> >  public void setPrice(java.math.BigDecimal ) {...};
> >  }
> >
> > JAXB specification considers those two cases different.
> >
> > At this time, this problem affects at least two annotations
> XmlRootElement
> > and XmlAttribute.
> >
> > Regards,
> > Bao
> >
>

Property changes on: C:\ldbao\castor\castor-jaxb-2.0\castor-jaxb-2.0
___
Name: svn:ignore
   - target
castor-log.txt

   + target
castor-log.txt
.classpath
.project
castor-log.txt
castor-log.txt.1
castor-log.txt.2
schema.xsd
.settings
bin
std
target
doc


Index: 
C:/ldbao/castor/castor-jaxb-2.0/castor-jaxb-2.0/src/main/java/org/castor/jaxb/reflection/info/FieldInfo.java
===
--- 
C:/ldbao/castor/castor-jaxb-2.0/castor-jaxb-2.0/src/main/java/org/castor/jaxb/reflection/info/FieldInfo.java
(revision 7702)
+++ 
C:/ldbao/castor/castor-jaxb-2.0/castor-jaxb-2.0/src/main/java/org/castor/jaxb/reflection/info/FieldInfo.java
(working copy)
@@ -73,8 +73,19 @@
 private String _enumValue;
 /** The generic type - if any. */
 private Type _genericType;
-
-/**
+
+/** indicator to XmlAttribute annotation */
+   private boolean _isAnnotatedXmlAttribute = false;
+   
+public boolean isAnnotatedXmlAttribute() {
+   return _isAnnotatedXmlAttribute;
+   }
+
+   public void setAnnotatedXmlAttribute(boolean isAnnotatedXmlAttribute) {
+   _isAnnotatedXmlAttribute = isAnnotatedXmlAttribute;
+   }
+
+   /**
  * Simple constructor.
  */
 public FieldInfo() {
Index: 
C:/ldbao/castor/castor-jaxb-2.0/castor-jaxb-2.0/src/main/java/org/castor/jaxb/reflection/FieldAnnotationProcessingService.java
===
--- 
C:/ldbao/castor/castor-jaxb-2.0/castor-jaxb-2.0/src/main/java/org/castor/jaxb/reflection/FieldAnnotationProcessingService.java
  (revision 7733)
+++ 
C:/ldbao/castor/castor-jaxb-2.0/castor-jaxb-2.0/src/main/java/org/castor/jaxb/reflection/FieldAnnotationProcessingService.java
  (working copy)
@@ -381,6 +381,7 @@
 fieldInfo.setAttributeName(xmlAttribute.name());
 fieldInfo.setAttributeNamespace(xmlAttribute.namespace());
 fieldInfo.setAttributeRequired(xmlAttribute.required());
+fieldInfo.setAnnotatedXmlAttribute(true);
 }
 } //-- processAnnotation
 
Index: C:/ldbao/castor/castor-jaxb-2.0/castor-jaxb-2.0/pom.xml
===
--- C:/ldbao/castor/castor-jaxb-2.0/castor-jaxb-2.0/pom.xml (revision 7702)
+++ C:/ldbao/castor/castor-jaxb-2.0/castor-jaxb-2.0/pom.xml (working copy)
@@ -1,425 +1,315 @@
-http://maven.apache.org/POM/4.0.0";
-   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
-
-   4.0.0
-   org.codehaus.castor
-   castor-jaxb
-   1.0-beta-1-SNAPSHOT
-   jar
-
-   Castor JAXB - An implementation of JAXB 2.1
-   
-   A layer to use Castor underneath and JAXB standard compliant API
-   and mapping definition.
-   
-   http://castor.org
-   
-   
-   
-   The Apache Software License, Version 2.0
-   
http://www.apache.org/licenses/LIC

[castor-dev] Re: Annotation processing

2008-07-20 Thread Joachim Grüneis
Hello,

I'm just back from vacation... so I haven't really taken a look onto
the problem...

the focus of the current implementation was just onto what I needed to
un/marshal JAXB conform but I didn't care if there is enough
information to generate a schema from the Java sources

can you please tell me (maybe as a patch) what information is needed
for you and I will bring it into the code base?

I will have a look onto it during this week - as soon as I'm settled
again at home

Have fun

Joachim

2008/7/18 Le Duc Bao <[EMAIL PROTECTED]>:
> Hello Joachim,
>
> It seems being a problem with annotation processing because of there are no
> indicator representing an annotation. For example
>
>  public class USPrice {
>  @XmlAttribute
>
>  public java.math.BigDecimal getPrice() {...} ;
>  public void setPrice(java.math.BigDecimal ) {...};
>  }
>
> So, the present of @XmlAttribute does not present in FieldInfo class so that
> we can not distinguish the above case with the code below during annotation
> processing:
>
>  public class USPrice {
>  public java.math.BigDecimal getPrice() {...} ;
>  public void setPrice(java.math.BigDecimal ) {...};
>  }
>
> JAXB specification considers those two cases different.
>
> At this time, this problem affects at least two annotations XmlRootElement
> and XmlAttribute.
>
> Regards,
> Bao
>

-
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email