org.millscript.millscript.tools
Class CastLibrary

java.lang.Object
  extended by org.millscript.millscript.tools.CastLibrary

public final class CastLibrary
extends java.lang.Object

Utility class to handle casting to a specific type from a plain object. All these casts support deferred objects.

See Also:
Deferred

Method Summary
static Binding toBinding(java.lang.Object x)
          Casts the supplied Object to a binding for a regular expression match.
static java.lang.Boolean toBoolean(java.lang.Object x)
          Casts the supplied Object to a Boolean.
static java.util.Calendar toCalendar(java.lang.Object x)
          Casts the supplied Object to a Calendar.
static java.lang.Character toCharacter(java.lang.Object x)
          Casts the supplied Object to a Character.
static DatabaseSource toDatabaseSource(java.lang.Object x)
          Casts the supplied Object to a DatabaseSource.
static Fragment toFragment(java.lang.Object x)
          Casts the supplied Object to a Fragment.
static Function toFunction(java.lang.Object x)
          Casts the supplied Object to a Function.
static org.millscript.commons.util.IList toIList(java.lang.Object x)
          Casts the supplied Object to a List.
static Image toImage(java.lang.Object x)
          Casts the supplied Object to an Image.
static org.millscript.commons.util.IMap toIMap(java.lang.Object x)
          Casts the supplied Object to a Map.
static int toInt(java.lang.Object x)
          Casts the supplied Object to an int value.
static java.lang.Integer toInteger(java.lang.Object x)
          Casts the supplied Object to an Integer.
static java.lang.Object[] toObjectArray(java.lang.Object x)
          Casts the supplied Object to an Object array.
static java.util.regex.Pattern toPattern(java.lang.Object x)
          Casts the supplied Object to an traditional regular expression Pattern.
static SpiceClass toSpiceClass(java.lang.Object x)
          Casts the supplied Object to a Spice Class.
static SpiceClassConstructorFunction toSpiceClassConstructorFunction(java.lang.Object x)
          Casts the supplied Object to a SpiceClassConstructorFunction.
static SpiceObject toSpiceObject(java.lang.Object x)
          Casts the supplied Object to a Spice Object.
static java.lang.String toString(java.lang.Object x)
          Casts the supplied Object to a String.
static Page toURL(java.lang.Object x)
          Casts the supplied Object to a URL.
static org.millscript.commons.vfs.VEntry toVEntry(java.lang.Object x)
          Casts the supplied Object to a VEntry.
static org.millscript.commons.vfs.VFile toVFile(java.lang.Object x)
          Casts the supplied Object to a VFile.
static org.millscript.commons.vfs.VFolder toVFolder(java.lang.Object x)
          Casts the supplied Object to a VFolder.
static XmlComment toXmlComment(java.lang.Object x)
          Casts the supplied Object to an XmlComment.
static XmlElement toXmlElement(java.lang.Object x)
          Casts the supplied Object to an XmlElement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toBinding

public static Binding toBinding(java.lang.Object x)
Casts the supplied Object to a binding for a regular expression match.

Parameters:
x - an object to cast to a Binding
Returns:
an Binding cast from the specified object

toBoolean

public static java.lang.Boolean toBoolean(java.lang.Object x)
Casts the supplied Object to a Boolean.

Parameters:
x - an object to cast to a Boolean
Returns:
an Boolean cast from the specified object

toCalendar

public static java.util.Calendar toCalendar(java.lang.Object x)
Casts the supplied Object to a Calendar.

Parameters:
x - an object to cast to an Calendar
Returns:
a Calendar from the top of the stack

toCharacter

public static java.lang.Character toCharacter(java.lang.Object x)
Casts the supplied Object to a Character.

Parameters:
x - an object to cast to an Character
Returns:
an Character from the top of the stack

toDatabaseSource

public static DatabaseSource toDatabaseSource(java.lang.Object x)
Casts the supplied Object to a DatabaseSource.

Parameters:
x - an object to cast to an DatabaseSource
Returns:
an DatabaseSource from the top of the stack

toFragment

public static Fragment toFragment(java.lang.Object x)
Casts the supplied Object to a Fragment. This method can be used in instances where an XmlComment or XmlElement is acceptable.

Parameters:
x - an object to cast to a Fragment
Returns:
a Fragment cast from the specified obect

toFunction

public static Function toFunction(java.lang.Object x)
Casts the supplied Object to a Function.

Parameters:
x - an object to cast to an Function
Returns:
an Function from the top of the stack

toIList

public static org.millscript.commons.util.IList toIList(java.lang.Object x)
Casts the supplied Object to a List.

Parameters:
x - an object to cast to an IList
Returns:
an IList cast from the specified object

toImage

public static Image toImage(java.lang.Object x)
Casts the supplied Object to an Image.

Parameters:
x - an object to cast to an Image
Returns:
an Image from the top of the stack

toIMap

public static org.millscript.commons.util.IMap toIMap(java.lang.Object x)
Casts the supplied Object to a Map.

Parameters:
x - an object to cast to an Map
Returns:
an Map cast from the specified object

toInt

public static int toInt(java.lang.Object x)
Casts the supplied Object to an int value.

Parameters:
x - an object to converted to an int
Returns:
an int from the specified object cast as an integer

toInteger

public static java.lang.Integer toInteger(java.lang.Object x)
Casts the supplied Object to an Integer.

Parameters:
x - an object to cast to an Integer
Returns:
an Integer from the top of the stack

toObjectArray

public static java.lang.Object[] toObjectArray(java.lang.Object x)
Casts the supplied Object to an Object array.

Parameters:
x - an object to cast to an object array
Returns:
an object array cast from the specified object

toPattern

public static java.util.regex.Pattern toPattern(java.lang.Object x)
Casts the supplied Object to an traditional regular expression Pattern.

Parameters:
x - an object to cast to a Pattern
Returns:
an Pattern cast from the specified object

toSpiceClass

public static SpiceClass toSpiceClass(java.lang.Object x)
Casts the supplied Object to a Spice Class.

Parameters:
x - an object to cast to an SpiceClass
Returns:
an SpiceClass from the top of the stack

toSpiceClassConstructorFunction

public static SpiceClassConstructorFunction toSpiceClassConstructorFunction(java.lang.Object x)
Casts the supplied Object to a SpiceClassConstructorFunction.

Parameters:
x - an object to cast to an SpiceClassConstructorFunction
Returns:
an SpiceClassConstructorFunction from the top of the stack

toSpiceObject

public static SpiceObject toSpiceObject(java.lang.Object x)
Casts the supplied Object to a Spice Object.

Parameters:
x - an object to cast to an SpiceObject
Returns:
an SpiceObject from the top of the stack

toString

public static java.lang.String toString(java.lang.Object x)
Casts the supplied Object to a String.

Parameters:
x - an object to cast to an String
Returns:
an String cast from the specified object

toURL

public static Page toURL(java.lang.Object x)
Casts the supplied Object to a URL.

Parameters:
x - an object to cast to a URL
Returns:
an object array cast from the specified object

toVEntry

public static org.millscript.commons.vfs.VEntry toVEntry(java.lang.Object x)
Casts the supplied Object to a VEntry.

Parameters:
x - an object to cast to a VEntry
Returns:
a VEntry cast from the specified obect

toVFile

public static org.millscript.commons.vfs.VFile toVFile(java.lang.Object x)
Casts the supplied Object to a VFile.

Parameters:
x - an object to cast to a VFile
Returns:
a VFile cast from the specified obect

toVFolder

public static org.millscript.commons.vfs.VFolder toVFolder(java.lang.Object x)
Casts the supplied Object to a VFolder.

Parameters:
x - an object to cast to a VFolder
Returns:
a VFolder cast from the specified obect

toXmlComment

public static XmlComment toXmlComment(java.lang.Object x)
Casts the supplied Object to an XmlComment.

Parameters:
x - an object to cast to an XmlComment
Returns:
an XmlComment cast from the specified object

toXmlElement

public static XmlElement toXmlElement(java.lang.Object x)
Casts the supplied Object to an XmlElement.

Parameters:
x - an object to cast to an XmlElement
Returns:
an XmlElement cast from the specified object


Copyright © 2001-2007 Open World Ltd. All Rights Reserved.