|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.common.rc.ResourceCollection
public class ResourceCollection
Implements the ResourceCollection interface.
| Field Summary | |
|---|---|
static java.lang.String |
ATTRIBUTE_GROUP_NAME
XML attribute for the group tag getting the name |
static java.lang.String |
ATTRIBUTE_IMPORT_CONTAINER
XML attribute for the import tag to get the container of the import resource (optional) |
static java.lang.String |
ATTRIBUTE_IMPORT_RESOURCE
XML attribute for the import tag to get the import resource (required) |
static java.lang.String |
ATTRIBUTE_PRELOAD
XML attribute for the root tag for preloading resource item generally |
protected java.lang.String |
containerName
Resource container name |
protected ResourceCollection |
parentResourceCollection
Parent resource |
protected static java.lang.String |
RESOURCE_EXTENSION
Property file extension |
static java.lang.String |
TAG_GROUP
XML tag property is a resource group |
static java.lang.String |
TAG_IMPORT
XML tag property is a import of another resource |
static java.lang.String |
TAG_RESOURCE
XML tag properties is the document root |
static java.lang.String |
TAG_RESOURCE_ITEM
XML tag property is a resource item |
| Constructor Summary | |
|---|---|
ResourceCollection(java.lang.String containerName,
java.lang.String resourceName,
java.util.Locale locale,
ResourceCollectionMgr resourceCollectionMgr,
java.io.InputStream stream)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addImport(ResourceCollection importedResourceCollection)
Add a imported resource to this resource. |
void |
addResourceItem(ResourceItem item)
Adds the resource item to the resource. |
protected ResourceItem |
createResourceItem(org.w3c.dom.Element resourceItemNode,
java.lang.String group,
boolean preload)
Create a resource object. |
java.lang.String |
getContainerName()
Gets the resource container name. |
java.lang.String |
getErrorName()
Returns a string that identifies the resource in error messages. |
java.util.Iterator |
getKeys()
Get all resource keys. |
java.util.Locale |
getLocale()
Gets the locale. |
java.lang.String |
getName()
Gets the name of the resource. |
java.lang.Object |
getOptionalObject(java.lang.String resourceItemName)
Gets a resource value. |
java.lang.Object |
getOptionalObject(java.lang.String resourceItemName,
java.lang.Object dflt)
Gets a resource value. |
java.lang.String |
getOptionalString(java.lang.String resourceItemName)
Gets a resource value as string. |
java.lang.String |
getOptionalString(java.lang.String resourceItemName,
java.lang.String dflt)
Gets a resource value as string. |
ResourceCollection |
getParentResource()
Gets the parent resource. |
java.lang.Object |
getRequiredObject(java.lang.String resourceItemName)
Gets a resource value. |
java.lang.String |
getRequiredString(java.lang.String resourceItemName)
Gets a resource value as string. |
ResourceCollectionMgr |
getResourceCollectionMgr()
Gets the locale resource manager. |
ResourceItem |
getResourceItem(java.lang.String resourceItemName)
Gets the resource item specified by its name. |
java.lang.String |
getResourceItemPath(java.lang.String relativePath)
Determines the file path of a file within a container for error message output. |
protected java.lang.Object |
getResourceObject(java.lang.String resourceItemName)
Get an object from a resource. |
java.lang.String |
getResourcePath()
Gets the path of the resource folder this resource resides in. |
protected void |
parseResource(org.w3c.dom.Element parentNode,
java.lang.String groupPath,
boolean preload)
Parses the DOM tree of a resource and adds all resource items it finds. |
protected void |
readFromInput(java.io.InputStream stream)
Reads the DOM tree of a resource and adds all resource items it finds. |
byte[] |
readResourceItem(java.lang.String relativePath)
Reads the (byte data) content of a resource collection item. |
void |
setParentResource(ResourceCollection parentResourceCollection)
Sets the parent resource. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String RESOURCE_EXTENSION
public static final java.lang.String TAG_RESOURCE
public static final java.lang.String ATTRIBUTE_PRELOAD
public static final java.lang.String TAG_RESOURCE_ITEM
public static final java.lang.String TAG_IMPORT
public static final java.lang.String ATTRIBUTE_IMPORT_RESOURCE
public static final java.lang.String ATTRIBUTE_IMPORT_CONTAINER
public static final java.lang.String TAG_GROUP
public static final java.lang.String ATTRIBUTE_GROUP_NAME
protected java.lang.String containerName
protected ResourceCollection parentResourceCollection
| Constructor Detail |
|---|
public ResourceCollection(java.lang.String containerName,
java.lang.String resourceName,
java.util.Locale locale,
ResourceCollectionMgr resourceCollectionMgr,
java.io.InputStream stream)
throws java.io.IOException,
org.xml.sax.SAXException
containerName - Resource container name or nullresourceName - Name of the resourcelocale - LocaleresourceCollectionMgr - Resource mgrstream - Input stream of the resource XML file
java.io.IOException - On i/o error
org.xml.sax.SAXException - On XML error| Method Detail |
|---|
public java.lang.String getResourcePath()
public java.lang.String getName()
public java.lang.String getContainerName()
public java.util.Locale getLocale()
public ResourceCollection getParentResource()
public void setParentResource(ResourceCollection parentResourceCollection)
public ResourceCollectionMgr getResourceCollectionMgr()
public java.lang.String getRequiredString(java.lang.String resourceItemName)
resourceItemName - Name of the resource item to get
public java.lang.Object getRequiredObject(java.lang.String resourceItemName)
resourceItemName - Name of the resource item to get
public java.lang.String getOptionalString(java.lang.String resourceItemName)
resourceItemName - Name of the resource item to get
public java.lang.String getOptionalString(java.lang.String resourceItemName,
java.lang.String dflt)
resourceItemName - Name of the resource item to getdflt - Default value
public java.lang.Object getOptionalObject(java.lang.String resourceItemName)
resourceItemName - Name of the resource item to get
public java.lang.Object getOptionalObject(java.lang.String resourceItemName,
java.lang.Object dflt)
resourceItemName - Name of the resource item to getdflt - Default value
public void addResourceItem(ResourceItem item)
item - Resource itempublic void addImport(ResourceCollection importedResourceCollection)
importedResourceCollection - The imported resourcepublic java.util.Iterator getKeys()
public ResourceItem getResourceItem(java.lang.String resourceItemName)
resourceItemName - Resource item name
public java.lang.String getErrorName()
protected java.lang.Object getResourceObject(java.lang.String resourceItemName)
resourceItemName - Resource item name
protected void readFromInput(java.io.InputStream stream)
throws java.io.IOException,
org.xml.sax.SAXException
stream - XML input stream
java.io.IOException - On I/O error
org.xml.sax.SAXException - On XML error
protected void parseResource(org.w3c.dom.Element parentNode,
java.lang.String groupPath,
boolean preload)
parentNode - Parent node to parsegroupPath - Resource group name to prepend to all resource items or nullpreload - true Preload any resource objects (images etc.)
protected ResourceItem createResourceItem(org.w3c.dom.Element resourceItemNode,
java.lang.String group,
boolean preload)
resourceItemNode - Resource item xml elementgroup - Group of the item or nullpreload - true The preload attribute of the resource file was set to truepublic byte[] readResourceItem(java.lang.String relativePath)
relativePath - Relative path of the item resource
public java.lang.String getResourceItemPath(java.lang.String relativePath)
relativePath - Relative path of the file
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||