Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 40156 invoked from network); 27 Apr 2004 20:00:37 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 27 Apr 2004 20:00:37 -0000 Received: (qmail 79591 invoked by uid 500); 27 Apr 2004 20:00:06 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 79514 invoked by uid 500); 27 Apr 2004 20:00:06 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 79456 invoked by uid 500); 27 Apr 2004 20:00:05 -0000 Received: (qmail 79431 invoked from network); 27 Apr 2004 20:00:05 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 27 Apr 2004 20:00:05 -0000 Received: (qmail 39962 invoked by uid 1289); 27 Apr 2004 20:00:16 -0000 Date: 27 Apr 2004 20:00:15 -0000 Message-ID: <20040427200015.39961.qmail@minotaur.apache.org> From: rdonkin@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/strategy ActionMappingStrategy.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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 Jakarta Commons Team * @version $Revision$ */ -public class ActionMappingStrategy { +public abstract class ActionMappingStrategy { + + /** + * Default ActionMappingStrategy + * 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 MappingAction, 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