org.openbp.common.rc
Class ResourceItem

java.lang.Object
  extended by org.openbp.common.rc.ResourceItem
Direct Known Subclasses:
AbstractJavaImage, TChar, TCharacter, TInteger, TKeystroke, TMulti, TPlain

public abstract class ResourceItem
extends java.lang.Object

Abstract ResourceItem implementation.

Author:
Andreas Putz

Field Summary
static java.lang.String ATTRIBUTE_PROPERTY_NAME
          XML 'name' attribute for the property tag
static java.lang.String ATTRIBUTE_PROPERTY_TYPE
          XML 'type' attribute for the property tag
static java.lang.String GROUP_DELIMITER
          The delimiter for the full qualified name
protected  java.lang.String name
          Resource name
protected  ResourceCollection resourceCollection
          Resource this item belongs to
protected  java.lang.Object resourceObject
          Resource object
 
Constructor Summary
protected ResourceItem()
          Constructor.
 
Method Summary
protected  java.lang.String getErrorName()
          Returns a string that identifies the resource item in error messages.
 java.lang.String getName()
          Gets the name of the resource item.
 java.lang.Object getObject()
          Gets the object associated with this resource.
 ResourceCollection getResourceCollection()
          Gets the resource this item belongs to.
 void initializeFromDOM(ResourceCollection resourceCollection, org.w3c.dom.Element source, java.lang.String group)
          Determines the information from the DOM element and set this to the resource item.
protected  java.lang.Object loadResourceObject()
          Loads the object associated with the resource.
 java.lang.String toString()
          Returns a string representation of this resource item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTRIBUTE_PROPERTY_NAME

public static final java.lang.String ATTRIBUTE_PROPERTY_NAME
XML 'name' attribute for the property tag

See Also:
Constant Field Values

ATTRIBUTE_PROPERTY_TYPE

public static final java.lang.String ATTRIBUTE_PROPERTY_TYPE
XML 'type' attribute for the property tag

See Also:
Constant Field Values

GROUP_DELIMITER

public static final java.lang.String GROUP_DELIMITER
The delimiter for the full qualified name

See Also:
Constant Field Values

name

protected java.lang.String name
Resource name


resourceObject

protected java.lang.Object resourceObject
Resource object


resourceCollection

protected ResourceCollection resourceCollection
Resource this item belongs to

Constructor Detail

ResourceItem

protected ResourceItem()
Constructor.

Method Detail

getName

public java.lang.String getName()
Gets the name of the resource item.


getObject

public java.lang.Object getObject()
Gets the object associated with this resource. Automatically tries to load the object if not done yet.

Returns:
The resource object or null if it could not be loaded

getResourceCollection

public ResourceCollection getResourceCollection()
Gets the resource this item belongs to.


loadResourceObject

protected java.lang.Object loadResourceObject()
Loads the object associated with the resource. The default implementation does nothing and returns null.

Returns:
The object or null on error

initializeFromDOM

public void initializeFromDOM(ResourceCollection resourceCollection,
                              org.w3c.dom.Element source,
                              java.lang.String group)
Determines the information from the DOM element and set this to the resource item.

Parameters:
resourceCollection - Resource the item belongs to
source - Resource item node
group - Resource group name or null

toString

public java.lang.String toString()
Returns a string representation of this resource item.

Overrides:
toString in class java.lang.Object

getErrorName

protected java.lang.String getErrorName()
Returns a string that identifies the resource item in error messages.



Copyright © 2011. All Rights Reserved.