railo.runtime.type
Class UDFImpl

java.lang.Object
  extended by railo.runtime.component.MemberSupport
      extended by railo.runtime.type.UDFImpl
All Implemented Interfaces:
Externalizable, Serializable, Cloneable, Member, Dumpable, Function, Duplicable, Sizeable, UDF
Direct Known Subclasses:
UDFGSProperty

public class UDFImpl
extends MemberSupport
implements UDF, Sizeable, Externalizable

defines a abstract class for a User defined Functions

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface railo.runtime.type.UDF
RETURN_FORMAT_JSON, RETURN_FORMAT_PLAIN, RETURN_FORMAT_SERIALIZE, RETURN_FORMAT_WDDX
 
Constructor Summary
UDFImpl()
          DO NOT USE THIS CONSTRUCTOR! this constructor is only for deserialize process
UDFImpl(Page page, FunctionArgument[] arguments, int index, String functionName, short returnType, String strReturnFormat, boolean output, boolean async, String strAccess, String displayName, String description, String hint, Boolean secureJson, Boolean verifyClient, StructImpl meta)
          Deprecated. use instead UDFImpl(UDFProperties properties)
UDFImpl(Page page, FunctionArgument[] arguments, int index, String functionName, String strReturnType, String strReturnFormat, boolean output, boolean async, String strAccess, String displayName, String description, String hint, Boolean secureJson, Boolean verifyClient, StructImpl meta)
          Deprecated. use instead UDFImpl(UDFProperties properties)
UDFImpl(UDFProperties properties)
           
 
Method Summary
static void argumentCollection(Struct values)
           
static void argumentCollection(Struct values, FunctionArgument[] funcArgs)
           
 Object call(PageContext pc, Object[] args, boolean doIncludePath)
          call user defined Funcion with parameters as Object Array
 Object callWithNamedValues(PageContext pc, Struct values, boolean doIncludePath)
          call user defined Funcion with a hashmap of named values
 Object clone()
           
 UDF duplicate()
           
 UDF duplicate(boolean deepCopy)
           
 UDF duplicate(ComponentImpl c)
           
 Object getDefaultValue(PageContext pc, int index)
           
 String getDescription()
           
 String getDisplayName()
           
 FunctionArgument[] getFunctionArguments()
          return all function arguments of this UDF
 String getFunctionName()
           
 String getHint()
           
 Struct getMeta()
           
 Struct getMetaData(PageContext pc)
           
 boolean getOutput()
           
 Component getOwnerComponent()
          it is the component in whitch this udf is constructed, must not be the same as active udf
 Page getPage()
          Deprecated. use instead getPageSource()
 PageSource getPageSource()
           
 int getReturnFormat()
           
 String getReturnFormatAsString()
           
 int getReturnType()
           
 String getReturnTypeAsString()
           
 Boolean getSecureJson()
          returns null when not defined
 Object getValue()
          return the value itself
 Boolean getVerifyClient()
          returns null when not defined
 Object implementation(PageContext pageContext)
          abstract method for the function Body
 void readExternal(ObjectInput in)
           
 void setOwnerComponent(ComponentImpl component)
           
 long sizeOf()
          return the size of the object
 DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp)
          method to print out information to a object as HTML
static DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp, UDF udf)
           
static Collection.Key toKey(Object obj)
           
static String toReturnFormat(int returnFormat)
           
static String toReturnFormat(int returnFormat, String defaultValue)
           
static int toReturnFormat(String returnFormat)
           
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class railo.runtime.component.MemberSupport
getAccess, setAccess, setAccess
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface railo.runtime.component.Member
getAccess
 

Constructor Detail

UDFImpl

public UDFImpl(Page page,
               FunctionArgument[] arguments,
               int index,
               String functionName,
               String strReturnType,
               String strReturnFormat,
               boolean output,
               boolean async,
               String strAccess,
               String displayName,
               String description,
               String hint,
               Boolean secureJson,
               Boolean verifyClient,
               StructImpl meta)
        throws ExpressionException
Deprecated. use instead UDFImpl(UDFProperties properties)

Constructor of the class

Parameters:
page -
arguments -
index -
functionName -
strReturnType -
strReturnFormat -
output -
async -
strAccess -
displayName -
description -
hint -
secureJson -
verifyClient -
meta -
Throws:
ExpressionException

UDFImpl

public UDFImpl(Page page,
               FunctionArgument[] arguments,
               int index,
               String functionName,
               short returnType,
               String strReturnFormat,
               boolean output,
               boolean async,
               String strAccess,
               String displayName,
               String description,
               String hint,
               Boolean secureJson,
               Boolean verifyClient,
               StructImpl meta)
        throws ExpressionException
Deprecated. use instead UDFImpl(UDFProperties properties)

Constructor of the class

Parameters:
page -
arguments -
index -
functionName -
returnType -
strReturnFormat -
output -
async -
strAccess -
displayName -
description -
hint -
secureJson -
verifyClient -
meta -
Throws:
ExpressionException

UDFImpl

public UDFImpl()
DO NOT USE THIS CONSTRUCTOR! this constructor is only for deserialize process


UDFImpl

public UDFImpl(UDFProperties properties)
Method Detail

sizeOf

public long sizeOf()
Description copied from interface: Sizeable
return the size of the object

Specified by:
sizeOf in interface Sizeable
Returns:
size of the object
See Also:
railo.runtime.engine.Sizeable#sizeOf()

duplicate

public UDF duplicate(ComponentImpl c)

duplicate

public UDF duplicate(boolean deepCopy)
Specified by:
duplicate in interface Duplicable

duplicate

public UDF duplicate()
Specified by:
duplicate in interface UDF

implementation

public Object implementation(PageContext pageContext)
                      throws Throwable
Description copied from interface: UDF
abstract method for the function Body

Specified by:
implementation in interface UDF
Throws:
Throwable
See Also:
UDF.implementation(railo.runtime.PageContext)

argumentCollection

public static void argumentCollection(Struct values)

argumentCollection

public static void argumentCollection(Struct values,
                                      FunctionArgument[] funcArgs)

toKey

public static Collection.Key toKey(Object obj)

callWithNamedValues

public Object callWithNamedValues(PageContext pc,
                                  Struct values,
                                  boolean doIncludePath)
                           throws PageException
Description copied from interface: UDF
call user defined Funcion with a hashmap of named values

Specified by:
callWithNamedValues in interface UDF
values - named values
Returns:
return value of the function
Throws:
PageException
See Also:
UDF.callWithNamedValues(railo.runtime.PageContext, railo.runtime.type.Struct, boolean)

call

public Object call(PageContext pc,
                   Object[] args,
                   boolean doIncludePath)
            throws PageException
Description copied from interface: UDF
call user defined Funcion with parameters as Object Array

Specified by:
call in interface UDF
args - parameters for the function
Returns:
return value of the function
Throws:
PageException
See Also:
UDF.call(railo.runtime.PageContext, java.lang.Object[], boolean)

toDumpData

public DumpData toDumpData(PageContext pageContext,
                           int maxlevel,
                           DumpProperties dp)
Description copied from interface: Dumpable
method to print out information to a object as HTML

Specified by:
toDumpData in interface Dumpable
Returns:
HTML print out
See Also:
railo.runtime.dump.Dumpable#toDumpData(railo.runtime.PageContext, int)

toDumpData

public static DumpData toDumpData(PageContext pageContext,
                                  int maxlevel,
                                  DumpProperties dp,
                                  UDF udf)

getDisplayName

public String getDisplayName()
Specified by:
getDisplayName in interface UDF
Returns:
Returns the displayName.
See Also:
UDF.getDisplayName()

getHint

public String getHint()
Specified by:
getHint in interface UDF
Returns:
Returns the hint.
See Also:
UDF.getHint()

getPage

public Page getPage()
Deprecated. use instead getPageSource()

Specified by:
getPage in interface UDF
Returns:
Returns the page.
See Also:
UDF.getPage()

getPageSource

public PageSource getPageSource()

getMeta

public Struct getMeta()

getMetaData

public Struct getMetaData(PageContext pc)
                   throws PageException
Specified by:
getMetaData in interface UDF
Throws:
PageException

getValue

public Object getValue()
Description copied from interface: Member
return the value itself

Specified by:
getValue in interface Member
Returns:
value

setOwnerComponent

public void setOwnerComponent(ComponentImpl component)
Parameters:
componentImpl - the componentImpl to set
injected -

getOwnerComponent

public Component getOwnerComponent()
Description copied from interface: UDF
it is the component in whitch this udf is constructed, must not be the same as active udf

Specified by:
getOwnerComponent in interface UDF
Returns:
owner component
See Also:
// FUTURE deprecated

toString

public String toString()
Overrides:
toString in class Object

getSecureJson

public Boolean getSecureJson()
Description copied from interface: UDF
returns null when not defined

Specified by:
getSecureJson in interface UDF
Returns:
value of attribute securejson
See Also:
UDF.getSecureJson()

getVerifyClient

public Boolean getVerifyClient()
Description copied from interface: UDF
returns null when not defined

Specified by:
getVerifyClient in interface UDF
Returns:
value of attribute verifyclient
See Also:
UDF.getVerifyClient()

clone

public Object clone()
Overrides:
clone in class Object

getFunctionArguments

public FunctionArgument[] getFunctionArguments()
Description copied from interface: UDF
return all function arguments of this UDF

Specified by:
getFunctionArguments in interface UDF
Returns:
the arguments.
See Also:
UDF.getFunctionArguments()

getDefaultValue

public Object getDefaultValue(PageContext pc,
                              int index)
                       throws PageException
Specified by:
getDefaultValue in interface UDF
Returns:
default value
Throws:
PageException
See Also:
UDF.getDefaultValue(railo.runtime.PageContext, int)

getFunctionName

public String getFunctionName()
Specified by:
getFunctionName in interface UDF
Returns:
Returns the functionName.
See Also:
UDF.getFunctionName()

getOutput

public boolean getOutput()
Specified by:
getOutput in interface UDF
Returns:
Returns the output.
See Also:
UDF.getOutput()

getReturnType

public int getReturnType()
Specified by:
getReturnType in interface UDF
Returns:
Returns the returnType.
See Also:
UDF.getReturnType()

getReturnTypeAsString

public String getReturnTypeAsString()
Specified by:
getReturnTypeAsString in interface UDF
Returns:
Returns the returnType.
See Also:
UDF.getReturnTypeAsString()

getDescription

public String getDescription()
Specified by:
getDescription in interface UDF
See Also:
UDF.getDescription()

getReturnFormat

public int getReturnFormat()
Specified by:
getReturnFormat in interface UDF
See Also:
UDF.getReturnFormat()

getReturnFormatAsString

public final String getReturnFormatAsString()

toReturnFormat

public static int toReturnFormat(String returnFormat)
                          throws ExpressionException
Throws:
ExpressionException

toReturnFormat

public static String toReturnFormat(int returnFormat)
                             throws ExpressionException
Throws:
ExpressionException

toReturnFormat

public static String toReturnFormat(int returnFormat,
                                    String defaultValue)

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException


Copyright © 2012 Railo