Return-Path: X-Original-To: apmail-subversion-users-archive@minotaur.apache.org Delivered-To: apmail-subversion-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0468F9D70 for ; Sun, 5 Feb 2012 15:56:24 +0000 (UTC) Received: (qmail 41624 invoked by uid 500); 5 Feb 2012 15:56:23 -0000 Delivered-To: apmail-subversion-users-archive@subversion.apache.org Received: (qmail 41592 invoked by uid 500); 5 Feb 2012 15:56:22 -0000 Mailing-List: contact users-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@subversion.apache.org Delivered-To: moderator for users@subversion.apache.org Received: (qmail 30082 invoked by uid 99); 4 Feb 2012 14:53:53 -0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dharma.a@gmail.com designates 209.85.214.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=643siCtcp7XoYaz9hN0O4NG4J+4YKNKHyiBs6ioNT/8=; b=j5UEtS/fpDedgOLXSv3r6XSGHcQK5tlxUUSfOYIu1cVYrzFyW5TEFCJs8h3DP/tLwK 7gaKU+YaqCiiX5XZWb7Qxjr9khru4k6SRxf6cDfK7HCfc0nQCA+xBVmd7DyYgazBs03R /erBjmdZSZXhPNKc/LUcDihe0hKuLe2CLm4l8= MIME-Version: 1.0 Date: Sat, 4 Feb 2012 20:23:24 +0530 Message-ID: Subject: Apache commons Digester Custom rule..... From: Dharma To: users@subversion.apache.org Content-Type: multipart/alternative; boundary=f46d0447887762996e04b82497d7 X-Virus-Checked: Checked by ClamAV on apache.org --f46d0447887762996e04b82497d7 Content-Type: text/plain; charset=ISO-8859-1 Hi, It would be great if i get solution for the below mentioned problem. I have a class which has only private constructor(two parameterised) and need to access the static variable of that class using digester. I understand that to access static variable of a class, need to use digester custom rule. Since am new to digester, if i get sample code for custom rule / list of steps to write custom rule would solve my problem. Please find below code snippet Eg: OrderStatus.java public class OrderStatus { private char type = ' '; public static final char A_TYPE = 'A'; public static final char T_TYPE = 'T'; public static final OrderStatus A = new OrderStatus(A_TYPE); // Need to get OrderStatus.A using digester public static final OrderStatus T = new OrderStatus(T_TYPE); // Need to get OrderStatus.T using digester private OrderStatus(char type) { super(); this.type = type; } } --f46d0447887762996e04b82497d7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,

=A0It would be great if i get so= lution for the below mentioned problem.

=A0I have a class which has = only private constructor(two parameterised) and need to access the static v= ariable of that class using digester.=A0 I understand that to access static= variable of a class, need to use digester custom rule.=A0 Since am new to = digester, if i get sample code for custom rule / list of steps to write cus= tom rule would solve my problem.
=A0
=A0Please find below code snippet=A0=A0=A0=A0=A0
=A0=A0
=A0E= g:

=A0 OrderStatus.java


=A0 public class OrderStatus
= =A0 {

=A0=A0=A0=A0 private char type =3D ' ';
=A0=A0=A0= =A0
=A0=A0=A0=A0 public static final char A_TYPE =3D 'A';
=A0=A0
=A0=A0=A0=A0 public static final char T_TYPE =3D 'T';
=A0=A0=A0=A0 public static final OrderStatus A =3D new OrderStatus(A_T= YPE);=A0 // Need to get OrderStatus.A using digester
=A0=A0
=A0=A0= =A0=A0=A0 public static final OrderStatus T =3D new OrderStatus(T_TYPE); //= Need to get OrderStatus.T using digester

=A0=A0=A0=A0=A0 private OrderStatus(char type)
=A0=A0=A0=A0=A0 {
= =A0=A0=A0=A0=A0=A0 super();
=A0=A0=A0=A0=A0=A0 this.type =3D type;
= =A0=A0=A0=A0=A0=A0 }

=A0 }



--f46d0447887762996e04b82497d7--