Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 99008 invoked from network); 13 Feb 2011 01:35:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Feb 2011 01:35:24 -0000 Received: (qmail 65782 invoked by uid 500); 13 Feb 2011 01:35:23 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 65713 invoked by uid 500); 13 Feb 2011 01:35:23 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 65705 invoked by uid 99); 13 Feb 2011 01:35:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Feb 2011 01:35:23 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Feb 2011 01:35:22 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 920E823889FD; Sun, 13 Feb 2011 01:35:02 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1070175 - /commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/utils/Annotations.java Date: Sun, 13 Feb 2011 01:35:02 -0000 To: commits@commons.apache.org From: simonetripodi@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110213013502.920E823889FD@eris.apache.org> Author: simonetripodi Date: Sun Feb 13 01:35:02 2011 New Revision: 1070175 URL: http://svn.apache.org/viewvc?rev=1070175&view=rev Log: added an utility method to extract the pattern() property from a digester annotation Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/utils/Annotations.java Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/utils/Annotations.java URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/utils/Annotations.java?rev=1070175&r1=1070174&r2=1070175&view=diff ============================================================================== --- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/utils/Annotations.java (original) +++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/utils/Annotations.java Sun Feb 13 01:35:02 2011 @@ -32,6 +32,11 @@ public class Annotations { private static final String VALUE = "value"; /** + * The {@code pattern} string constant. + */ + private static final String PATTERN = "pattern"; + + /** * This class can't be instantiated. */ private Annotations() { @@ -49,6 +54,20 @@ public class Annotations { } /** + * Extract the {@code pattern()} from annotation. + * + * @param annotation the annotation has to be introspected. + * @return the annotation {@code pattern()}. + */ + public static String getAnnotationPattern(Annotation annotation) { + Object ret = invokeAnnotationMethod(annotation, PATTERN); + if (ret != null) { + return (String) ret; + } + return null; + } + + /** * Extract the Annotations array {@code value()} from annotation if present, * nul otherwise. *