railo.runtime.text.xml
Class XMLCaster

java.lang.Object
  extended by railo.runtime.text.xml.XMLCaster

public final class XMLCaster
extends Object

Cast Objects to XML Objects of different types


Constructor Summary
XMLCaster()
           
 
Method Summary
static Attr toAttr(Document doc, Object o)
          casts a value to a XML Attribute Object
static Attr[] toAttrArray(Document doc, Object o)
          casts a value to a XML Attr Array
static Text toCDATASection(Document doc, Object o)
           
static Comment toComment(Document doc, Object o)
          casts a value to a XML Comment Object
static Comment[] toCommentArray(Document doc, Object o)
          casts a value to a XML Comment Array
static DumpData toDumpData(Node node, PageContext pageContext, int maxlevel, DumpProperties props)
          Casts a XML Node to a HTML Presentation
static Element toElement(Document doc, Object o)
          casts a value to a XML Element
static Element[] toElementArray(Document doc, Object o)
          casts a value to a XML Element Array
static String toHTML(Node node)
           
static Node toNode(Document doc, Object o)
           
static Node toNode(Document doc, Object o, short type)
          casts a value to a XML Object defined by type parameter
static Node toNode(Object o)
          Deprecated. replaced with toRawNode
static Node[] toNodeArray(Document doc, Object o)
          casts a value to a XML Element Array
static Node[] toNodeArray(Document doc, Object o, short type)
          casts a value to a XML Object Array defined by type parameter
static Element toRawElement(Object value, Element defaultValue)
           
static Node toRawNode(Node node)
          remove railo node wraps (XMLStruct) from node
static String toString(Node node)
           
static String toString(Node node, boolean omitXMLDecl)
           
static String toString(Node node, boolean omitXMLDecl, String publicId, String systemId, String encoding)
           
static String toString(NodeList nodes, boolean omitXMLDecl)
           
static String toString(Node node, String defaultValue)
           
static Text toText(Document doc, Object o)
          casts a value to a XML Text
static Text[] toTextArray(Document doc, Object o)
          casts a value to a XML Text Array
static XMLStruct toXMLStruct(Node node, boolean caseSensitive)
          creates a XMLCollection Object from a Node
static void writeTo(Node node, Resource file)
          write a xml Dom to a file
static void writeTo(Node node, Result res, boolean omitXMLDecl, String publicId, String systemId, String encoding)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLCaster

public XMLCaster()
Method Detail

toText

public static Text toText(Document doc,
                          Object o)
                   throws PageException
casts a value to a XML Text

Parameters:
doc - XML Document
o - Object to cast
Returns:
XML Text Object
Throws:
PageException

toCDATASection

public static Text toCDATASection(Document doc,
                                  Object o)
                           throws PageException
Throws:
PageException

toTextArray

public static Text[] toTextArray(Document doc,
                                 Object o)
                          throws PageException
casts a value to a XML Text Array

Parameters:
doc - XML Document
o - Object to cast
Returns:
XML Text Array
Throws:
PageException

toAttr

public static Attr toAttr(Document doc,
                          Object o)
                   throws PageException
casts a value to a XML Attribute Object

Parameters:
doc - XML Document
o - Object to cast
Returns:
XML Comment Object
Throws:
PageException

toAttrArray

public static Attr[] toAttrArray(Document doc,
                                 Object o)
                          throws PageException
casts a value to a XML Attr Array

Parameters:
doc - XML Document
o - Object to cast
Returns:
XML Attr Array
Throws:
PageException

toComment

public static Comment toComment(Document doc,
                                Object o)
                         throws PageException
casts a value to a XML Comment Object

Parameters:
doc - XML Document
o - Object to cast
Returns:
XML Comment Object
Throws:
PageException

toCommentArray

public static Comment[] toCommentArray(Document doc,
                                       Object o)
                                throws PageException
casts a value to a XML Comment Array

Parameters:
doc - XML Document
o - Object to cast
Returns:
XML Comment Array
Throws:
PageException

toElement

public static Element toElement(Document doc,
                                Object o)
                         throws PageException
casts a value to a XML Element

Parameters:
doc - XML Document
o - Object to cast
Returns:
XML Element Object
Throws:
PageException

toElementArray

public static Element[] toElementArray(Document doc,
                                       Object o)
                                throws PageException
casts a value to a XML Element Array

Parameters:
doc - XML Document
o - Object to cast
Returns:
XML Comment Array
Throws:
PageException

toNode

public static Node toNode(Object o)
                   throws PageException
Deprecated. replaced with toRawNode

casts a value to a XML Node

Parameters:
doc - XML Document
o - Object to cast
Returns:
XML Element Object
Throws:
PageException

toRawNode

public static Node toRawNode(Node node)
remove railo node wraps (XMLStruct) from node

Parameters:
node -
Returns:
raw node (without wrap)

toNode

public static Node toNode(Document doc,
                          Object o)
                   throws PageException
Throws:
PageException

toNodeArray

public static Node[] toNodeArray(Document doc,
                                 Object o)
                          throws PageException
casts a value to a XML Element Array

Parameters:
doc - XML Document
o - Object to cast
Returns:
XML Comment Array
Throws:
PageException

toNode

public static Node toNode(Document doc,
                          Object o,
                          short type)
                   throws PageException
casts a value to a XML Object defined by type parameter

Parameters:
doc - XML Document
o - Object to cast
type - type to cast to
Returns:
XML Text Object
Throws:
PageException

toNodeArray

public static Node[] toNodeArray(Document doc,
                                 Object o,
                                 short type)
                          throws PageException
casts a value to a XML Object Array defined by type parameter

Parameters:
doc - XML Document
o - Object to cast
type - type to cast to
Returns:
XML Node Array Object
Throws:
PageException

toHTML

public static String toHTML(Node node)
                     throws ExpressionException
Throws:
ExpressionException

writeTo

public static void writeTo(Node node,
                           Resource file)
                    throws PageException
write a xml Dom to a file

Parameters:
node -
file -
Throws:
PageException

toString

public static String toString(Node node)
                       throws PageException
Throws:
PageException

toString

public static String toString(Node node,
                              boolean omitXMLDecl)
                       throws PageException
Throws:
PageException

toString

public static String toString(Node node,
                              boolean omitXMLDecl,
                              String publicId,
                              String systemId,
                              String encoding)
                       throws PageException
Throws:
PageException

toString

public static String toString(NodeList nodes,
                              boolean omitXMLDecl)
                       throws PageException
Throws:
PageException

toString

public static String toString(Node node,
                              String defaultValue)

writeTo

public static void writeTo(Node node,
                           Result res,
                           boolean omitXMLDecl,
                           String publicId,
                           String systemId,
                           String encoding)
                    throws PageException
Throws:
PageException

toDumpData

public static DumpData toDumpData(Node node,
                                  PageContext pageContext,
                                  int maxlevel,
                                  DumpProperties props)
Casts a XML Node to a HTML Presentation

Parameters:
node -
pageContext -
Returns:
html output

toXMLStruct

public static XMLStruct toXMLStruct(Node node,
                                    boolean caseSensitive)
creates a XMLCollection Object from a Node

Parameters:
node -
caseSensitive -
Returns:
xmlstruct from node

toRawElement

public static Element toRawElement(Object value,
                                   Element defaultValue)


Copyright © 2012 Railo