|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
The IPropertiesResource is an abstract view of XML resources, java property
files or whatever.
It provides convenient methods to parse the nodes hierarchy without
knowing anything about the file format.
For example :
IPropertiesResource countries =
(IPropertiesResource)(request.getResource("weather", "xml", "city.xml"));
if ( countries.isAvailable()==true )
{
Enumeration enum = countries.getChildren();
while (enum.hasMoreElements())
{
IPropertiesResource country = (IPropertiesResource)(enum.nextElement());
System.out.println("CountryName="+country.getAttributeValue("name"));
}
}
IResource,
IResourceInformation,
IPortalComponentRequest.getResource(String, String, String),
IPortalComponentResponse.addResource(IResource)| Fields inherited from interface com.sapportals.portal.prt.resource.IResource |
APPLET, CSS, IMAGE, JSP, PAGELET, PRIVATE_SCOPE, PROFILE, PROPERTY, PUBLIC_SCOPE, SCOPE_SEPARATOR, SCRIPT, STATIC_PAGE, SYSTEM_RESOURCE, XML |
| Method Summary | |
java.util.Enumeration |
getAttributeNames()
returns an enumeration of attributes |
java.lang.String |
getAttributeValue(java.lang.String key)
returns the value related to the provided key. |
java.util.Enumeration |
getChildren()
returns an array of IPropertiesResource children or null if no there is no child. |
java.util.Enumeration |
getChildren(java.lang.String tagName)
returns an array of IPropertiesResource children which correspond to the tag name or null if no there is no child. |
java.lang.String |
getNodeName()
returns the name of this node |
java.lang.String |
getNodeValue()
returns the value of this node |
void |
setAttributeValue(java.lang.String key,
java.lang.String value)
sets the value related to the provided key. |
void |
store()
Updates the content of the file. |
| Methods inherited from interface com.sapportals.portal.prt.resource.IResource |
getResourceInformation, init, isAvailable |
| Method Detail |
public java.util.Enumeration getAttributeNames()
public java.lang.String getAttributeValue(java.lang.String key)
key -
public void setAttributeValue(java.lang.String key,
java.lang.String value)
key - value - public java.lang.String getNodeName()
public java.lang.String getNodeValue()
public java.util.Enumeration getChildren()
public java.util.Enumeration getChildren(java.lang.String tagName)
tagName -
public void store()
throws PortalRuntimeException
PortalRuntimeException -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||