You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by rd...@apache.org on 2004/02/03 23:29:15 UTC

cvs commit: jakarta-commons/betwixt/src/java/org/apache/commons/betwixt BeanProperty.java IntrospectionConfiguration.java

rdonkin     2004/02/03 14:29:15

  Modified:    betwixt/src/java/org/apache/commons/betwixt Tag:
                        REFACTORING-BRANCH_2004-01-13 BeanProperty.java
                        IntrospectionConfiguration.java
  Log:
  Added support for simple type mapping strategy
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.4.2.8   +11 -5     jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/BeanProperty.java
  
  Index: BeanProperty.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/BeanProperty.java,v
  retrieving revision 1.4.2.7
  retrieving revision 1.4.2.8
  diff -u -r1.4.2.7 -r1.4.2.8
  --- BeanProperty.java	29 Jan 2004 22:15:22 -0000	1.4.2.7
  +++ BeanProperty.java	3 Feb 2004 22:29:15 -0000	1.4.2.8
  @@ -74,6 +74,7 @@
   import org.apache.commons.betwixt.expression.MethodUpdater;
   import org.apache.commons.betwixt.expression.Updater;
   import org.apache.commons.betwixt.strategy.NameMapper;
  +import org.apache.commons.betwixt.strategy.SimpleTypeMapper;
   import org.apache.commons.logging.Log;
   
   /** 
  @@ -414,7 +415,12 @@
           if (log.isTraceEnabled()) {
               log.trace( "Primitive type: " + getPropertyName());
           }
  -        if ( configuration.isAttributesForPrimitives() ) {
  +        SimpleTypeMapper.Binding binding 
  +            = configuration.getSimpleTypeMapper().bind(
  +                                                        propertyName, 
  +                                                        propertyType, 
  +                                                        configuration);
  +        if ( SimpleTypeMapper.Binding.ATTRIBUTE.equals( binding )) {
               if (log.isTraceEnabled()) {
                   log.trace( "Adding property as attribute: " + getPropertyName() );
               }
  
  
  
  1.1.2.4   +26 -4     jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/Attic/IntrospectionConfiguration.java
  
  Index: IntrospectionConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/Attic/IntrospectionConfiguration.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- IntrospectionConfiguration.java	1 Feb 2004 22:55:47 -0000	1.1.2.3
  +++ IntrospectionConfiguration.java	3 Feb 2004 22:29:15 -0000	1.1.2.4
  @@ -67,6 +67,8 @@
   import org.apache.commons.betwixt.strategy.NameMapper;
   import org.apache.commons.betwixt.strategy.NamespacePrefixMapper;
   import org.apache.commons.betwixt.strategy.PluralStemmer;
  +import org.apache.commons.betwixt.strategy.SimpleTypeMapper;
  +import org.apache.commons.betwixt.strategy.StandardSimpleTypeMapper;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
  @@ -120,6 +122,8 @@
   
       /** Prefix naming strategy */
       private NamespacePrefixMapper prefixMapper = new NamespacePrefixMapper();
  +    /** Binding strategy for simple types */
  +    private SimpleTypeMapper simpleTypeMapper = new StandardSimpleTypeMapper();
   
   
       /**
  @@ -323,4 +327,22 @@
       public void setPrefixMapper(NamespacePrefixMapper mapper) {
           prefixMapper = mapper;
       }
  +    
  +    
  +    /**
  +     * Gets the simple type binding strategy.
  +     * @return SimpleTypeMapper, not null
  +     */
  +    public SimpleTypeMapper getSimpleTypeMapper() {
  +        return simpleTypeMapper;
  +    }
  +
  +    /**
  +     * Sets the simple type binding strategy.
  +     * @param mapper SimpleTypeMapper, not null
  +     */
  +    public void setSimpleTypeMapper(SimpleTypeMapper mapper) {
  +        simpleTypeMapper = mapper;
  +    }
  +
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org