org.owasp.orizon.core
Class Method

java.lang.Object
  extended by org.owasp.orizon.O
      extended by org.owasp.orizon.core.Method

public class Method
extends O

The Method object represents:

Since:
0.11
Author:
sp0nge

Field Summary
 
Fields inherited from class org.owasp.orizon.O
base64, hasName, initialized, line_start, line_stop, log, name, reduced, what
 
Constructor Summary
Method()
          Deprecated.  
Method(org.w3c.dom.Node n)
          Creates a new Method object from an XML node
Method(java.lang.String name)
          Deprecated.  
 
Method Summary
 int addParam(Param oP)
          Adds a method parameter
 boolean check(Check c)
          As far from version 0.62 all items must be responsible for checking themselves for security vulnerabilities.
 java.lang.String getBody()
          Gets the method body
 java.lang.String getCode()
          Returns the method code
 Param getParam(int index)
          Returns a method parameter
 int getParamCount()
          Calculates how many parameters are available
 java.lang.String getRetType()
          Return method return type.
 java.lang.String getScope()
          Gets the method scope
 boolean hasEmptyCatch()
          Returns the emptyCatch flag value
 boolean isPublic()
          Check this method's scope.
 boolean readXmlNode(org.w3c.dom.Node n)
          As far from version 0.62 all items must be responsible for XML Node reading routine.
 void setBody(java.lang.String body)
          Sets the method body
 void setCode(java.lang.String code)
          Sets the method code
 void setEmptyCatch()
          Sets the emptyCatch flag to true
 void setIsPublic(boolean pub)
          Set this method scope.
 void setRetType(java.lang.String retType)
          Set the method return type.
 void setScope(java.lang.String scope)
          Sets the method scope
 java.lang.String signature()
          Prints out the method signature
 java.lang.String signature(boolean forceStatic)
          Prints out the method signature
 
Methods inherited from class org.owasp.orizon.O
clone, getName, getStartLine, getStopLine, isCompatible, isInitialized, setName, setStartLine, setStopLine, trackThis
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Method

public Method()
Deprecated. 

Create a new Method()


Method

public Method(java.lang.String name)
Deprecated. 

Create a new OrizonMethod()

Parameters:
name - the method name

Method

public Method(org.w3c.dom.Node n)
Creates a new Method object from an XML node

Parameters:
n - the XML node being read
Method Detail

getRetType

public final java.lang.String getRetType()
Return method return type.

Returns:
this method return type or an empty string is object isn't properly initialized.

setRetType

public final void setRetType(java.lang.String retType)
Set the method return type.

Parameters:
retType - the method return type.

isPublic

public final boolean isPublic()
Check this method's scope.

Returns:
true if the method is public or false otherwise

setIsPublic

public final void setIsPublic(boolean pub)
Set this method scope.

Parameters:
pub - true if the method is public, false otherwise.

setEmptyCatch

public void setEmptyCatch()
Sets the emptyCatch flag to true


hasEmptyCatch

public boolean hasEmptyCatch()
Returns the emptyCatch flag value

Returns:
true if method contains an empty flag, false otherwise.

addParam

public int addParam(Param oP)
Adds a method parameter

Parameters:
oP - the org.owasp.orizon.core.Param object to add
Returns:
the parameter index or -1 if an error occured.

getParam

public Param getParam(int index)
Returns a method parameter

Parameters:
index - the requested parameter index
Returns:
the requested parameter or null if the index is out of parameter array bounds.

getCode

public final java.lang.String getCode()
Returns the method code

Returns:
returns the method code

setCode

public final void setCode(java.lang.String code)
Sets the method code

Parameters:
code - the method code to set.

getParamCount

public final int getParamCount()
Calculates how many parameters are available

Returns:
returns the number of parameter.

getBody

public java.lang.String getBody()
Gets the method body

Returns:
returns the method body

setBody

public void setBody(java.lang.String body)
Sets the method body

Parameters:
body - the method body to be set up

signature

public java.lang.String signature()
Prints out the method signature

Returns:
the method signature

signature

public java.lang.String signature(boolean forceStatic)
Prints out the method signature

Parameters:
forceStatic - tell if the method must be forced to be static in signature
Returns:
the method signature

setScope

public final void setScope(java.lang.String scope)
Sets the method scope

Parameters:
scope - the method scope

getScope

public final java.lang.String getScope()
Gets the method scope

Returns:
the method scope

readXmlNode

public boolean readXmlNode(org.w3c.dom.Node n)
Description copied from class: O
As far from version 0.62 all items must be responsible for XML Node reading routine. Source class must be able to instantiate an object passing XML Node as parameter and having that code read

Specified by:
readXmlNode in class O
Parameters:
n - the node being read
Returns:
true if xml node is well formed and correctly read, or false otherwise.

check

public boolean check(Check c)
Description copied from class: O
As far from version 0.62 all items must be responsible for checking themselves for security vulnerabilities.

Specified by:
check in class O
Parameters:
c - the security check that must be applied
Returns:
true if a security issue as been found or false otherwise