commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject cvs commit: jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/strategy ActionMappingStrategy.java
Date Tue, 27 Apr 2004 20:00:15 GMT
rdonkin     2004/04/27 13:00:15

  Modified:    betwixt/src/java/org/apache/commons/betwixt/strategy Tag:
                        REFACTORING-BRANCH_2004-01-13
                        ActionMappingStrategy.java
  Log:
  Added support for array property setters
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.3   +14 -26    jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/strategy/Attic/ActionMappingStrategy.java
  
  Index: ActionMappingStrategy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/strategy/Attic/ActionMappingStrategy.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- ActionMappingStrategy.java	18 Apr 2004 17:34:38 -0000	1.1.2.2
  +++ ActionMappingStrategy.java	27 Apr 2004 20:00:15 -0000	1.1.2.3
  @@ -61,11 +61,8 @@
   
   package org.apache.commons.betwixt.strategy;
   
  -import org.apache.commons.betwixt.ElementDescriptor;
  -import org.apache.commons.betwixt.io.read.BeanBindAction;
   import org.apache.commons.betwixt.io.read.MappingAction;
   import org.apache.commons.betwixt.io.read.ReadContext;
  -import org.apache.commons.betwixt.io.read.SimpleTypeBindAction;
   import org.xml.sax.Attributes;
   
   /**
  @@ -82,9 +79,15 @@
    * @author <a href='http://jakarta.apache.org/'>Jakarta Commons Team</a>
    * @version $Revision$
    */
  -public class ActionMappingStrategy {
  +public abstract class ActionMappingStrategy {
  +    
  +    /**
  +     * Default <code>ActionMappingStrategy</code>
  +     * used by betwixt
  +     */
  +    public static final ActionMappingStrategy DEFAULT 
  +                        = new DefaultActionMappingStrategy();
       
  -
       /**
        * Gets the mapping action to map the given element.
        * @param namespace not null
  @@ -94,25 +97,10 @@
        * @return <code>MappingAction</code>, not null
        * @throws Exception
        */
  -    public MappingAction getMappingAction(    
  +    public abstract MappingAction getMappingAction(    
                               String namespace,
                               String name,
                               Attributes attributes,
                               ReadContext context)
  -        throws Exception {
  -        MappingAction result = MappingAction.EMPTY;
  -            
  -        ElementDescriptor activeDescriptor = context.getCurrentDescriptor();
  -        if (activeDescriptor != null) {
  -            if (activeDescriptor.isHollow())
  -            {
  -                result = BeanBindAction.INSTANCE;
  -            }
  -            else if (activeDescriptor.isSimple())
  -            {
  -                result = SimpleTypeBindAction.INSTANCE;
  -            }
  -        }
  -        return result;
  -    }
  +        throws Exception;
   }
  
  
  

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


Mime
View raw message