Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 9271 invoked from network); 29 Sep 2006 18:20:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Sep 2006 18:20:39 -0000 Received: (qmail 40534 invoked by uid 500); 29 Sep 2006 18:20:36 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 40508 invoked by uid 500); 29 Sep 2006 18:20:36 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: 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 40490 invoked by uid 500); 29 Sep 2006 18:20:36 -0000 Received: (qmail 40487 invoked by uid 99); 29 Sep 2006 18:20:36 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Sep 2006 11:20:36 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME Received: from [140.211.166.113] ([140.211.166.113:55083] helo=eris.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id C6/2B-13110-FB36D154 for ; Fri, 29 Sep 2006 11:20:00 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 44CB21A9846; Fri, 29 Sep 2006 11:19:01 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r451375 - /jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/CustomDigester.java Date: Fri, 29 Sep 2006 18:19:01 -0000 To: commons-cvs@jakarta.apache.org From: rahul@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20060929181901.44CB21A9846@eris.apache.org> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: rahul Date: Fri Sep 29 11:19:00 2006 New Revision: 451375 URL: http://svn.apache.org/viewvc?view=rev&rev=451375 Log: Add CustomDigester package scoped class, deprecated at the onset. Ideally, this should never be released. Opens the door to better XPath support. SCXML-24 Added: jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/CustomDigester.java (with props) Added: jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/CustomDigester.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/CustomDigester.java?view=auto&rev=451375 ============================================================================== --- jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/CustomDigester.java (added) +++ jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/CustomDigester.java Fri Sep 29 11:19:00 2006 @@ -0,0 +1,63 @@ +/* + * + * Copyright 2005-2006 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.scxml.io; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import org.apache.commons.collections.ArrayStack; +import org.apache.commons.digester.Digester; + +/** + *

Digester that exposes a getCurrentNamespaces() + * method, for capturing namespace snapshots.

+ * + * @deprecated Will be removed after the 1.8 release of Commons Digester. + */ +final class CustomDigester extends Digester { + + /** + * Get the most current namespaces for all prefixes. + * + * @return Map A map with namespace prefixes as keys and most current + * namespace URIs for the corresponding prefixes as values + * + */ + public Map getCurrentNamespaces() { + if (!namespaceAware) { + log.warn("Digester is not namespace aware"); + } + Map currentNamespaces = new HashMap(); + Iterator nsIterator = namespaces.entrySet().iterator(); + while (nsIterator.hasNext()) { + Map.Entry nsEntry = (Map.Entry) nsIterator.next(); + try { + currentNamespaces.put(nsEntry.getKey(), + ((ArrayStack) nsEntry.getValue()).peek()); + } catch (RuntimeException e) { + // rethrow, after logging + log.error(e.getMessage(), e); + throw e; + } + } + return currentNamespaces; + } + +} + Propchange: jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/CustomDigester.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/CustomDigester.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org