org.compass.core.xml
Interface XmlObject

All Superinterfaces:
Serializable
All Known Subinterfaces:
AliasedXmlObject
All Known Implementing Classes:
Dom4jAliasedXmlObject, Dom4jXmlObject, NodeAliasedXmlObject, NodeXmlObject, RawAliasedXmlObject, RawXmlObject

public interface XmlObject
extends Serializable

A wrapper for an Xml Object. Used with XSEM to support mapping between Xml and Search Engine. The Xml Object can be an Xml element/attribute/... .

Author:
kimchy

Method Summary
 boolean canCompileXpath()
          Returns true of the xml object supports xpath expression compilation.
 XmlXPathExpression compile(String path)
          Compiles the given xpath expression.
 String getName()
          Returns the name of the xml object.
 String getValue()
          Returns the value of the xml object.
 XmlObject[] selectPath(String path)
          Returns a list of xml objects matching the given xpath expression.
 

Method Detail

getName

String getName()
Returns the name of the xml object. Should be the element/attribute name.


getValue

String getValue()
Returns the value of the xml object.


selectPath

XmlObject[] selectPath(String path)
                       throws Exception
Returns a list of xml objects matching the given xpath expression. Note, that the actual xml implementation might support only xpath expression compliation, so it is ok not to implement this method.

Parameters:
path - The xpath expression
Returns:
A list of xml objects matching the given xpath expression
Throws:
Exception

canCompileXpath

boolean canCompileXpath()
Returns true of the xml object supports xpath expression compilation.


compile

XmlXPathExpression compile(String path)
                           throws Exception
Compiles the given xpath expression.

Parameters:
path - The xpath expression
Returns:
The compiled xpath expression
Throws:
Exception


Copyright (c) 2004-2008 The Compass Project.