Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 44933 invoked from network); 27 Aug 2004 21:14:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 27 Aug 2004 21:14:40 -0000 Received: (qmail 98108 invoked by uid 500); 27 Aug 2004 21:14:37 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 98054 invoked by uid 500); 27 Aug 2004 21:14:37 -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 98039 invoked by uid 500); 27 Aug 2004 21:14:36 -0000 Received: (qmail 98036 invoked by uid 99); 27 Aug 2004 21:14:36 -0000 X-ASF-Spam-Status: No, hits=-2.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.27.1) with SMTP; Fri, 27 Aug 2004 14:14:36 -0700 Received: (qmail 44857 invoked by uid 1289); 27 Aug 2004 21:14:35 -0000 Date: 27 Aug 2004 21:14:35 -0000 Message-ID: <20040827211435.44856.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/digester ConfigRule.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N rdonkin 2004/08/27 14:14:35 Added: betwixt/src/java/org/apache/commons/betwixt/digester ConfigRule.java Log: Multi mapping document support. Contributed by Brian Pugh. Revision Changes Path 1.1 jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/digester/ConfigRule.java Index: ConfigRule.java =================================================================== /* * Copyright 2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.betwixt.digester; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.xml.sax.Attributes; import org.xml.sax.SAXException; /** * Digester Rule to process config elements. * @author Brian Pugh */ public class ConfigRule extends RuleSupport { /** Logger. */ private static final Log log = LogFactory.getLog(ConfigRule.class); /** Base constructor. */ public ConfigRule() { } // Rule interface //------------------------------------------------------------------------- /** * Process the beginning of this element. * * @param attributes The attribute list of this element * @throws org.xml.sax.SAXException if the primitiveTypes attribute contains an invalid value */ public void begin(Attributes attributes) throws SAXException { String value = attributes.getValue("primitiveTypes"); if (value != null) { if (value.equalsIgnoreCase("element")) { getXMLInfoDigester().setAttributesForPrimitives(false); } else if (value.equalsIgnoreCase("attribute")) { getXMLInfoDigester().setAttributesForPrimitives(true); } else { throw new SAXException( "Invalid value inside element for attribute 'primitiveTypes'." + " Value should be 'element' or 'attribute'"); } } MultiMappingBeanInfoDigester digester = (MultiMappingBeanInfoDigester) getDigester(); getDigester().push(digester.getBeanInfoMap()); } /** * Process the end of this element. */ public void end() { Object top = getDigester().pop(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org