de.nava.informa.core
Interface WithElementsAndAttributesMIF

All Known Subinterfaces:
ChannelIF, ItemIF
All Known Implementing Classes:
Channel, Channel, Channel, Item, Item, Item

public interface WithElementsAndAttributesMIF

Meta-, or markerinterface, specifying objects, having nested elements & attributes.

Version:
$Id: WithElementsAndAttributesMIF.java,v 1.3 2005/09/27 22:17:07 niko_schmuck Exp $
Author:
Alexei Matiouchkine

Method Summary
 String getAttributeValue(String path, String attribute)
          Returns the value of the attribute of the Channel's child element reached by the given path.
 String[] getAttributeValues(String path, String[] attributes)
          Returns the values of the specified attributes of the Channel's child element reached by the given path.
 String getElementValue(String path)
          Returns the value of the Channel's child element reached by the given path.
 String[] getElementValues(String path, String[] elements)
          Returns the values of the specified sub-elements of the Channel's child reached by the given path.
 

Method Detail

getElementValue

String getElementValue(String path)
Returns the value of the Channel's child element reached by the given path.
For example, getElementValue("image/title") will return the title of the Channel's image element.

Parameters:
path - a path to the child. Paths are specified as element names, separated by a "/". Namespaces are allowed. e.g. "aaa:bbb/ccc:ddd/eee".
Returns:
the value of the child. Returns null if path is null.

getElementValues

String[] getElementValues(String path,
                          String[] elements)
Returns the values of the specified sub-elements of the Channel's child reached by the given path. This is useful in cases where a child has several children.
For example, getElementValues("image", new String[] {"title", "url", "link", "width", "height", "description"} ) will return the specified sub-elements of the "image" element.

Parameters:
path - a path to the child. Paths are specified as element names, separated by a "/". Namespaces are allowed. e.g. "aaa:bbb/ccc:ddd/eee".
elements - An array of element names. May contain namespace specifiers.
Returns:
an array containing the value of each element.
If path is null, returns the specified sub-elements for the Channel. If elements is null, returns null.

getAttributeValue

String getAttributeValue(String path,
                         String attribute)
Returns the value of the attribute of the Channel's child element reached by the given path.
For example, getAttributeValue("admin:generatorAgent", "rdf:resource") will return the "rdf:resource" attribute of the Channel's "admin:generatorAgent" element.

Parameters:
path - a path to the root of the elements. Paths are specified as element names, separated by a "/".
attribute - the attribute. May contain a namespace specifier e.g. "rdf:resource".
Returns:
the value of the attribute.
If path is null, returns the specified attribute for the Channel. If attribute is null, returns null.

getAttributeValues

String[] getAttributeValues(String path,
                            String[] attributes)
Returns the values of the specified attributes of the Channel's child element reached by the given path. This is useful in cases where a child has several attributes.

Parameters:
path - a path to the child. Paths are specified as element names, separated by a "/". Namespaces are allowed. e.g. "aaa:bbb/ccc:ddd/eee".
attributes - An array of element names. May contain namespace specifiers.
Returns:
an array containing the value of each attribute.
If path is null, returns the specified attributes for the Channel. If attributes is null, returns null.


Copyright © 2002-2007 Niko Schmuck. All Rights Reserved.