org.apache.axis.wsdl.fromJava
Class ClassRep

java.lang.Object
  |
  +--org.apache.axis.wsdl.fromJava.BaseRep
        |
        +--org.apache.axis.wsdl.fromJava.ClassRep

public class ClassRep
extends BaseRep

ClassRep is the representation of a class used inside the Java2WSDL emitter. The information in the ClassRep can be changed by user provided code to affect the emitted wsdl file. If you wish to change the functionality (for example change the getParameterNames(...) algorithm), here is one way to do it: 1) Extend ClassRep class (MyClassRep) and override the desired methods. 2) Extend the DefaultBuilderBeanClassRep and DefaultBuilderPortTypeClasses and provide new build(...) methods that construct MyClassRep objects. 3) Extend the DefaultFactory class (MyFactory) so that it locates your new Builder classes. 4) Provide MyFactory as an option when your invoke Java2WSDL. name ClassRep +-+---------> String | | | | | | | | | | | | isIntf | | | | | +---------> boolean | | | | | | | | | | modifiers | | | | +-----------> int (use java.lang.reflect.Modifier to decode) | | | | | | | | super | | | +-------------> ClassRep | | | | | | interfaces | | +---------------> ClassRep(s) | | | | methods | +-----------------> MethodRep(s) | | fields +-------------------> FieldRep(s) name MethodRep ----------> String | | | | | | return | | +-----------> ParamRep | | | | params | +-------------> ParamRep | | exceptions +----------------> ExceptionRep name ExceptionRep ----------> String | | params +-------------> ParamRep name ParamRep -----------> String | | | | type | +-------------> Class | | mode +---------------> int (in/out/inout) name FieldRep -----------> String | | type +--------------> Class Note: all classes extend BaseRep where meta data information can be stored.

Author:
Rich Scheuerle (scheu@us.ibm.com)

Constructor Summary
ClassRep()
          Constructor Create an empty ClassRep
ClassRep(java.lang.Class cls, boolean inhMethods, java.util.List stopList)
          Constructor Create a default representation of ClassRep
ClassRep(java.lang.Class cls, boolean inhMethods, java.util.List stopList, java.lang.Class implClass)
           
 
Method Summary
protected  void addFields(java.lang.Class cls)
          Adds FieldReps to the ClassRep.
protected  void addMethods(java.lang.Class cls, boolean inhMethods, java.lang.Class implClass)
          Adds MethodReps to the ClassRep.
 java.util.Vector getFields()
           
 java.util.Vector getInterfaces()
           
protected  void getMethodMetaData(MethodRep methodRep, java.lang.reflect.Method method, java.lang.Class implClass)
          Gets additional meta data and sets it on the MethodRep.
protected  boolean getMethodMetaDataFromSkeleton(MethodRep methodRep, java.lang.reflect.Method method)
          Gets additional meta data and sets it on the MethodRep.
 java.util.Vector getMethods()
           
 int getModifiers()
           
 java.lang.String getName()
          Getters/Setters
protected  ParameterMode[] getParameterModes(java.lang.reflect.Method method)
          Get the list of return/parameter modes for the specified method.
protected  ParameterMode[] getParameterModes(java.lang.reflect.Method method, java.lang.Class implClass)
          Get the list of return/parameter modes for the specified method.
protected  ParameterMode[] getParameterModesFromSkeleton(java.lang.reflect.Method method)
          Get the list of return/parameter modes for the specified method.
protected  java.lang.String[] getParameterNames(java.lang.reflect.Method method, java.lang.Class implClass)
          Get the list of parameter names for the specified method.
protected  java.lang.String[] getParameterNamesFromSkeleton(java.lang.reflect.Method method)
          Get the list of parameter names for the specified method.
protected  java.lang.Class[] getParameterTypes(java.lang.reflect.Method method)
          Get the list of parameter types for the specified method.
 ClassRep getSuper()
           
protected  void init(java.lang.Class cls, boolean inhMethods, java.util.List stopList, java.lang.Class implClass)
           
 boolean isInterface()
           
protected  boolean isJavaBeanIndexed(java.lang.Class cls, java.lang.String name, java.lang.Class type)
          Determines if the Property in the Class has bean compliant indexed accessors.
protected  boolean isJavaBeanNormal(java.lang.Class cls, java.lang.String name, java.lang.Class type)
          Determines if the Property in the class has been compliant accessors.
 void setFields(java.util.Vector v)
           
 void setInterfaces(java.util.Vector v)
           
 void setIsInterface(boolean b)
           
 void setMethods(java.util.Vector v)
           
 void setModifiers(int m)
           
 void setName(java.lang.String name)
           
 void setSuper(ClassRep cr)
           
 
Methods inherited from class org.apache.axis.wsdl.fromJava.BaseRep
getMetaData, setMetaData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassRep

public ClassRep()
Constructor Create an empty ClassRep

ClassRep

public ClassRep(java.lang.Class cls,
                boolean inhMethods,
                java.util.List stopList)
Constructor Create a default representation of ClassRep
Parameters:
cls - Class to use to create default ClassRep
inhMethods - if true, then the methods array will contain methods declared and/or inherited else only the declared methods are put in the list
stopList - An optional vector of class names which if inhMethods is true, will stop the inheritence search if encountered.
implClass - This is an optional parameter which is a class that implements or extends cls. The implClass is used to obtain parameter names.

ClassRep

public ClassRep(java.lang.Class cls,
                boolean inhMethods,
                java.util.List stopList,
                java.lang.Class implClass)
Method Detail

init

protected void init(java.lang.Class cls,
                    boolean inhMethods,
                    java.util.List stopList,
                    java.lang.Class implClass)

getName

public java.lang.String getName()
Getters/Setters

setName

public void setName(java.lang.String name)

isInterface

public boolean isInterface()

setIsInterface

public void setIsInterface(boolean b)

getModifiers

public int getModifiers()

setModifiers

public void setModifiers(int m)

getSuper

public ClassRep getSuper()

setSuper

public void setSuper(ClassRep cr)

getInterfaces

public java.util.Vector getInterfaces()

setInterfaces

public void setInterfaces(java.util.Vector v)

getMethods

public java.util.Vector getMethods()

setMethods

public void setMethods(java.util.Vector v)

getFields

public java.util.Vector getFields()

setFields

public void setFields(java.util.Vector v)

addMethods

protected void addMethods(java.lang.Class cls,
                          boolean inhMethods,
                          java.lang.Class implClass)
Adds MethodReps to the ClassRep.
Parameters:
cls - the Class
inhMethods - if true, then the methods array will contain methods declared and/or inherited else only the declared methods are put in the list
implClass - This is an optional parameter which is a class that implements or extends cls. The implClass is used to obtain parameter names.

addFields

protected void addFields(java.lang.Class cls)
Adds FieldReps to the ClassRep.
Parameters:
cls - the Class A complexType component element will be generated for each FieldRep. This implementation generates FieldReps for public data fields and also for properties exposed by java bean accessor methods.

getParameterTypes

protected java.lang.Class[] getParameterTypes(java.lang.reflect.Method method)
Get the list of parameter types for the specified method. This implementation uses the specified type unless it is a holder class, in which case the held type is used.
Parameters:
method - is the Method.
Returns:
array of parameter types.

getParameterNames

protected java.lang.String[] getParameterNames(java.lang.reflect.Method method,
                                               java.lang.Class implClass)
Get the list of parameter names for the specified method. This implementation uses Skeleton.getParameterNames or bcel to get the parameter names from the class file. If parameter names are not available for the method (perhaps the method is in an interface), the corresponding method in the implClass is queried.
Parameters:
method - is the Method to search.
implClass - If the first search fails, the corresponding Method in this class is searched.
Returns:
array of Strings which represent the return name followed by parameter names

getParameterNamesFromSkeleton

protected java.lang.String[] getParameterNamesFromSkeleton(java.lang.reflect.Method method)
Get the list of parameter names for the specified method. This implementation uses Skeleton.getParameterNames to get the parameter names from the class file. If parameter names are not available, returns null.
Parameters:
method - is the Method to search.
Returns:
array of Strings which represent the return name followed by parameter names

getParameterModes

protected ParameterMode[] getParameterModes(java.lang.reflect.Method method,
                                            java.lang.Class implClass)
Get the list of return/parameter modes for the specified method. This implementation uses Skeleton.getParameterModes to get the modes If parameter modes are not available for the method (perhaps the method is in an interface), the corresponding method in the implClass is queried.
Parameters:
method - is the Method to search.
implClass - If the first search fails, the corresponding Method in this class is searched.
Returns:
array of Strings which represent the return mode followed by parameter modes

getParameterModesFromSkeleton

protected ParameterMode[] getParameterModesFromSkeleton(java.lang.reflect.Method method)
Get the list of return/parameter modes for the specified method. This implementation uses Skeleton.getParameterModes to get the parameter modes from the class file. If parameter modes are not available, returns null.
Parameters:
method - is the Method to search.
Returns:
array of Strings which represent the return mode followed by parameter modes

getParameterModes

protected ParameterMode[] getParameterModes(java.lang.reflect.Method method)
Get the list of return/parameter modes for the specified method. This default implementation assumes IN unless the type is a holder class
Parameters:
method - is the Method.
Returns:
array of parameter modes.

getMethodMetaData

protected void getMethodMetaData(MethodRep methodRep,
                                 java.lang.reflect.Method method,
                                 java.lang.Class implClass)
Gets additional meta data and sets it on the MethodRep.
Parameters:
methodRep - is the target MethodRep.
method - is the Method to search.
implClass - If the first search fails, the corresponding Method in this class is searched.

getMethodMetaDataFromSkeleton

protected boolean getMethodMetaDataFromSkeleton(MethodRep methodRep,
                                                java.lang.reflect.Method method)
Gets additional meta data and sets it on the MethodRep.
Parameters:
methodRep - is the target MethodRep.
method - is the Method to search.
Returns:
true if the method is part of a skeleton.

isJavaBeanNormal

protected boolean isJavaBeanNormal(java.lang.Class cls,
                                   java.lang.String name,
                                   java.lang.Class type)
Determines if the Property in the class has been compliant accessors. If so returns true, else returns false
Parameters:
cls - the Class
name - is the name of the property
type - is the type of the property
Returns:
true if the Property has JavaBean style accessors

isJavaBeanIndexed

protected boolean isJavaBeanIndexed(java.lang.Class cls,
                                    java.lang.String name,
                                    java.lang.Class type)
Determines if the Property in the Class has bean compliant indexed accessors. If so returns true, else returns false
Parameters:
cls - the Class
name - is the name of the property
type - is the type of the property
Returns:
true if the Property has JavaBean style accessors


Copyright © 2001 Apache XML Project. All Rights Reserved.