Package org.chenile.owiz.config.impl
Class CreateOrUseExistingRule<T>
java.lang.Object
org.apache.commons.digester.Rule
org.apache.commons.digester.ObjectCreateRule
org.chenile.owiz.config.impl.CreateOrUseExistingRule<T>
- Type Parameters:
T
- .
public class CreateOrUseExistingRule<T>
extends org.apache.commons.digester.ObjectCreateRule
Useful as an enhancement over the ObjectCreateRule for digester. This one creates a new object or uses an existing one if an old one
was already created using the same ID. The ID has to be an attribute for the given xml tag. Its name is "id" by default
but can be changed to something else if required. The finderMethod is
the method to call on the previous object in the digester stack ( the object that is assumed to "collect" all the IDs so far)
to obtain the
old object if an old object was already created for that Id. The finderMethod must accept the "id" and nothing else and return the
already created object.
Only string ids are supported.
- Author:
- Raja Shankar Kolluru
-
Field Summary
Modifier and TypeFieldDescriptionprivate String
private String
private String
private static final String
private String
Fields inherited from class org.apache.commons.digester.ObjectCreateRule
attributeName, className
Fields inherited from class org.apache.commons.digester.Rule
digester, namespaceURI
-
Constructor Summary
-
Method Summary
Methods inherited from class org.apache.commons.digester.ObjectCreateRule
toString
Methods inherited from class org.apache.commons.digester.Rule
begin, body, body, end, finish, getDigester, getNamespaceURI, setDigester, setNamespaceURI
-
Field Details
-
ID
- See Also:
-
finderMethod
-
classToCreate
-
idAttributeName
-
alternateStackToPushTo
-
endMethod
-
-
Constructor Details
-
CreateOrUseExistingRule
-
CreateOrUseExistingRule
-
-
Method Details