net.ponder2.objects
Class P2XML

java.lang.Object
  extended by net.ponder2.objects.P2Object
      extended by net.ponder2.objects.P2XML
All Implemented Interfaces:
java.io.Serializable, P2Serializable, ManagedObject, Ponder2Message

public class P2XML
extends P2Object
implements ManagedObject

This is an internal Ponder2 XML object type. It represents an XML structure which can be operated upon with XPath commands

Version:
$Id:$
Author:
Kevin Twidle
See Also:
Serialized Form

Constructor Summary
protected P2XML()
          constructor for Ponder2 serialisation
 
Method Summary
 java.lang.String asString()
          Returns itself as a String
 P2Object asXML()
          Returns itself, used for compatibility with other types
 P2Object readXml(com.twicom.qdparser.TaggedElement xml, java.util.Map<java.lang.Integer,P2Serializable> read)
           
 java.lang.String toString()
           
 com.twicom.qdparser.TaggedElement writeXml(java.util.Set<P2Object> written)
           
 boolean xPathBoolean(java.lang.String anXPathExpression)
          Answers a boolean generated by applying anXPathExpression to the receiver
 P2XML xPathNode(java.lang.String anXPathExpression)
          Answers an XML element generated by applying anXPathExpression to the receiver
 P2Array xPathNodeSet(java.lang.String anXPathExpression)
          Answers an array with XML elements generated by applying anXPathExpression to the receiver
 int xPathNumber(java.lang.String anXPathExpression)
          Answers a number generated by applying anXPathExpression to the receiver
 java.lang.String xPathString(java.lang.String anXPathExpression)
          Answers a string generated by applying anXPathExpression to the receiver
 
Methods inherited from class net.ponder2.objects.P2Object
asArray, asBlock, asBoolean, asClass, asDouble, asFloat, asHash, asInteger, asLong, asNumber, asP2Array, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, fromXml, getManagedObject, getOID, getSMC, operation, operation, setSMC
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

P2XML

protected P2XML()
constructor for Ponder2 serialisation

Method Detail

xPathNodeSet

public P2Array xPathNodeSet(java.lang.String anXPathExpression)
                     throws Ponder2OperationException
Answers an array with XML elements generated by applying anXPathExpression to the receiver

Parameters:
anXPathExpression - the XPath expression to be executed
Returns:
an array with the XPath results
Throws:
Ponder2OperationException

xPathNode

public P2XML xPathNode(java.lang.String anXPathExpression)
                throws Ponder2OperationException
Answers an XML element generated by applying anXPathExpression to the receiver

Parameters:
anXPathExpression - the XPath expression to be executed
Returns:
the result of the XPath expression
Throws:
Ponder2OperationException

xPathString

public java.lang.String xPathString(java.lang.String anXPathExpression)
                             throws Ponder2OperationException
Answers a string generated by applying anXPathExpression to the receiver

Parameters:
anXPathExpression - the XPath expression to be executed
Returns:
the result string of the XPath expression
Throws:
Ponder2OperationException

xPathBoolean

public boolean xPathBoolean(java.lang.String anXPathExpression)
                     throws Ponder2OperationException
Answers a boolean generated by applying anXPathExpression to the receiver

Parameters:
anXPathExpression - the XPath expression to be executed
Returns:
the result boolean of the XPath expression
Throws:
Ponder2OperationException

xPathNumber

public int xPathNumber(java.lang.String anXPathExpression)
                throws Ponder2OperationException
Answers a number generated by applying anXPathExpression to the receiver

Parameters:
anXPathExpression - the XPath expression to be executed
Returns:
the result number of the XPath expression
Throws:
Ponder2OperationException

asString

public java.lang.String asString()
                          throws Ponder2OperationException
Description copied from class: P2Object
Returns itself as a String

Overrides:
asString in class P2Object
Returns:
the String value
Throws:
Ponder2OperationException

asXML

public P2Object asXML()
Returns itself, used for compatibility with other types

Returns:
itself

writeXml

public com.twicom.qdparser.TaggedElement writeXml(java.util.Set<P2Object> written)
                                           throws Ponder2OperationException
Specified by:
writeXml in interface P2Serializable
Overrides:
writeXml in class P2Object
Throws:
Ponder2OperationException

readXml

public P2Object readXml(com.twicom.qdparser.TaggedElement xml,
                        java.util.Map<java.lang.Integer,P2Serializable> read)
                 throws Ponder2OperationException,
                        Ponder2ArgumentException
Specified by:
readXml in interface P2Serializable
Specified by:
readXml in class P2Object
Throws:
Ponder2OperationException
Ponder2ArgumentException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2008 Imperial College. All Rights Reserved.