org.apache.xml.utils.synthetic.reflection
Class EntryPoint

java.lang.Object
  extended byorg.apache.xml.utils.synthetic.reflection.EntryPoint
All Implemented Interfaces:
Member
Direct Known Subclasses:
Constructor, Method

public abstract class EntryPoint
extends Object
implements Member

API/behaviors shared between Constructors and Methods. They're mostly similar, except for what they proxy and a few specific calls (name, invoke/getInstance).


Field Summary
private  StringBuffer body
          Field body
private  Class declaringclass
          Field declaringclass
private  Class[] exceptiontypes
          Field exceptiontypes
private  String language
          Field language
private  int modifiers
          Field modifiers
protected  String name
          Field name
private  String[] parameternames
          Field parameternames
private  Class[] parametertypes
          Field parametertypes
(package private)  Class[] realE
          Field realE, realP
protected  Object realep
          Field realep
(package private)  Class[] realP
          Field realE, realP
protected  Class returntype
          Field returntype
 
Constructor Summary
  EntryPoint(Class declaringclass)
          Insert the method's description here.
protected EntryPoint(Object ep)
          Nonpublic constructor.
protected EntryPoint(Object ep, Class declaringclass)
          Nonpublic constructor.
 
Method Summary
 void addExceptionType(Class exception)
          Method addExceptionType
 void addParameter(Class type, String name)
          Method addParameter
 boolean equals(Object obj)
          Compares this against the specified object.
 StringBuffer getBody()
          Extension: For synthesis, we need a place to hang a method body.
 Class getDeclaringClass()
          Returns the Class object representing the class that declares the constructor represented by this Constructor object.
 Class[] getExceptionTypes()
          Returns an array of Class objects that represent the types of the checked exceptions thrown by the underlying constructor represented by this Constructor object.
 String getLanguage()
          Extension: For synthesis, we need a place to hang a method body.
 int getModifiers()
          Returns the Java language modifiers for the constructor represented by this Constructor object, as an integer.
 String getName()
          Member method.
 String[] getParameterNames()
          Method getParameterNames (getParameterNames) @return
 Class[] getParameterTypes()
          Returns an array of Class objects that represent the formal parameter types, in declaration order, of the constructor represented by this Constructor object.
 Class getReturnType()
          Returns the Class object representing the class that will be returned by this EntryPoint.
abstract  int hashCode()
          Returns a hashcode for this Constructor.
 void setBody(String language, StringBuffer body)
          Extension: For synthesis, we need a place to hang a method body.
 void setDeclaringClass(Class declaringClass)
          Assert the Class object representing the class that declares the constructor represented by this Constructor object.
 void setModifiers(int modifiers)
          Should only be accepted before a "real" entrypoint is bound.
 void setName(String name)
          Member method.
 String toSource(String basetab)
          Generate Java code
 String toString()
          Return a string describing this Constructor.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

realep

protected Object realep
Field realep


declaringclass

private Class declaringclass
Field declaringclass


returntype

protected Class returntype
Field returntype


parameternames

private String[] parameternames
Field parameternames


parametertypes

private Class[] parametertypes
Field parametertypes


exceptiontypes

private Class[] exceptiontypes
Field exceptiontypes


modifiers

private int modifiers
Field modifiers


name

protected String name
Field name


body

private StringBuffer body
Field body


language

private String language
Field language


realE

Class[] realE
Field realE, realP


realP

Class[] realP
Field realE, realP

Constructor Detail

EntryPoint

public EntryPoint(Class declaringclass)
Insert the method's description here.

Creation date: (12-27-99 2:31:39 PM)

Parameters:
declaringclass -

EntryPoint

protected EntryPoint(Object ep,
                     Class declaringclass)
              throws IllegalArgumentException
Nonpublic constructor. Wrap this to appropriate "real" type

Parameters:
ep -
declaringclass -
Throws:
IllegalArgumentException

EntryPoint

protected EntryPoint(Object ep)
              throws IllegalArgumentException
Nonpublic constructor. Wrap this to appropriate "real" type

Parameters:
ep -
Throws:
IllegalArgumentException
Method Detail

equals

public boolean equals(Object obj)
Compares this against the specified object. Returns true if the objects are the same. Two EntryPoints are the same if they were declared by the same class, have the same name (or are both ctors) and have the same formal parameter types.

Overrides:
equals in class Object
Parameters:
obj -
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Object.hashCode(), Hashtable

getDeclaringClass

public Class getDeclaringClass()
Returns the Class object representing the class that declares the constructor represented by this Constructor object.

Specified by:
getDeclaringClass in interface Member

getReturnType

public Class getReturnType()
Returns the Class object representing the class that will be returned by this EntryPoint. Needed by the Method API, but made meaningful for Constructors as well.


getExceptionTypes

public Class[] getExceptionTypes()
Returns an array of Class objects that represent the types of the checked exceptions thrown by the underlying constructor represented by this Constructor object. Returns an array of length 0 if the constructor throws no checked exceptions.


addExceptionType

public void addExceptionType(Class exception)
                      throws SynthesisException
Method addExceptionType

Parameters:
exception -
Throws:
SynthesisException

getModifiers

public int getModifiers()
Returns the Java language modifiers for the constructor represented by this Constructor object, as an integer. The Modifier class should be used to decode the modifiers.

Specified by:
getModifiers in interface Member

getName

public String getName()
Member method. C'tor's name is always that of the defining class. Methods have a "real" name. Creation date: (12-25-99 1:32:06 PM)

Returns:
java.lang.String

setName

public void setName(String name)
             throws SynthesisException
Member method. C'tor's name is always that of the defining class. Methods have a "real" name. Creation date: (12-25-99 1:32:06 PM)

Parameters:
name -
Returns:
java.lang.String
Throws:
SynthesisException

getParameterTypes

public Class[] getParameterTypes()
Returns an array of Class objects that represent the formal parameter types, in declaration order, of the constructor represented by this Constructor object. Returns an array of length 0 if the underlying constructor takes no parameters.


getParameterNames

public String[] getParameterNames()
Method getParameterNames (getParameterNames) @return


addParameter

public void addParameter(Class type,
                         String name)
                  throws SynthesisException
Method addParameter

Parameters:
type -
name -
Throws:
SynthesisException

hashCode

public abstract int hashCode()
Returns a hashcode for this Constructor. The hashcode is the same as the hashcode for the underlying constructor's declaring class name, xor'ed (for Methods) with the method name. (Implemented in the subclasses rather than here.)

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object), Hashtable

setDeclaringClass

public void setDeclaringClass(Class declaringClass)
                       throws SynthesisException
Assert the Class object representing the class that declares the constructor represented by this Constructor object.

Specified by:
setDeclaringClass in interface Member
Parameters:
declaringClass -
Throws:
SynthesisException

setModifiers

public void setModifiers(int modifiers)
                  throws SynthesisException
Should only be accepted before a "real" entrypoint is bound. Creation date: (12-25-99 1:28:28 PM)

Specified by:
setModifiers in interface Member
Parameters:
modifiers - int
Returns:
int
Throws:
SynthesisException

toString

public String toString()
Return a string describing this Constructor. The string is formatted as the constructor access modifiers, if any, followed by the fully-qualified name of the declaring class, followed by a parenthesized, comma-separated list of the constructor's formal parameter types. For example: public java.util.Hashtable(int,float)

The only possible modifiers for constructors are the access modifiers public, protected or private. Only one of these may appear, or none if the constructor has default (package) access.

Methods will also display their checked exceptions.

Overrides:
toString in class Object
Returns:
a string representation of the object.

setBody

public void setBody(String language,
                    StringBuffer body)
             throws SynthesisException
Extension: For synthesis, we need a place to hang a method body.

Parameters:
language -
body -
Throws:
SynthesisException

getBody

public StringBuffer getBody()
Extension: For synthesis, we need a place to hang a method body. Note that this returns a mutable object, for editing etc. Slightly sloppy first cut.


getLanguage

public String getLanguage()
Extension: For synthesis, we need a place to hang a method body.


toSource

public String toSource(String basetab)
Generate Java code

Parameters:
basetab -