Package org.glassfish.rmic.iiop
Class CompoundType.Method
java.lang.Object
org.glassfish.rmic.iiop.CompoundType.Method
- All Implemented Interfaces:
Cloneable
,ContextElement
- Enclosing class:
CompoundType
A CompoundType.Method object encapsulates IIOP-specific information
about a particular method in the interface represented by the outer
instance.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String[]
private Type[]
private int
private String
private int
private Identifier
private CompoundType
private ValueType[]
private String
private ValueType[]
private MemberDefinition
private String
private Type
private String
private String
-
Constructor Summary
ConstructorsConstructorDescriptionMethod
(CompoundType enclosing, MemberDefinition memberDef, boolean quiet, ContextStack stack) Create a new Method object corresponding to the given method definition. -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
clone()
Cloning is supported by returning a shallow copy of this object.private void
collectCompatibleExceptions
(ValueType[] from, ValueType[] with, Vector<ValueType> list) Add to the supplied list all exceptions in the "from" array that are subclasses of an exception in the "with" array.void
destroy()
Release all resources.boolean
Equality check based on method signature.String[]
Return the names of the argument types of this method.Type[]
Return the argument types of this method.int
Return the attribute kind.Return the attribute name.int
For kinds ATTRIBUTE_GET_RW or ATTRIBUTE_IS_RW, return the index of the matching ATTRIBUTE_SET method, and vice-versa.Return the identifier for the class or interface which declares this method.Return context element name.Return the compound type which contains this method.Return an array of the exception classes declared to be thrown by this remote method.getFilteredStubExceptions
(ValueType[] list) Return an array containing only those exceptions which need to be handled explicitly by the stub.IDL_Naming Return the IDL name of this method.Same as getExceptions(), except when method is in an ImplementationType and the exceptions list is narrower.Return the MemberDefinition from which this method was created.getName()
Return the name of this method.Get the return type of this method.getType()
Return the type of this method.getUniqueCatchList
(ValueType[] list) Return an array containing only those exceptions which need to be caught.Return the visibility (e.g.int
hashCode()
boolean
Is this method an attribute? Return true if getAttributeKind != ATTRIBUTE_NONE.boolean
Return true if this is a constructor.boolean
Is this method inherited?boolean
Return true if this is NOT a constructor&&
is not an attribute.boolean
boolean
boolean
isPublic()
Methods to check various attributes.boolean
Is this method a read-write attribute?boolean
isStatic()
private String
makeArgName
(int argNum, Type type) Make up an argument name for the given type.mergeWith
(CompoundType.Method other) Return a new Method object that is a legal combination of this method object and another one.void
setAttributeKind
(int kind) Set attribute kind.void
setAttributeName
(String name) Set attribute name.void
setAttributePairIndex
(int index) Set pair index.void
Set the declaredBy Identifier.void
setIDLName
(String idlName) Set the idl name.void
setImplExceptions
(ValueType[] exceptions) Set the implExceptions array.protected void
Convert all invalid types to valid ones.toString()
Return the string representation of this method.
-
Field Details
-
memberDef
-
enclosing
-
exceptions
-
implExceptions
-
returnType
-
arguments
-
argumentNames
-
vis
-
name
-
idlName
-
stringRep
-
attributeKind
private int attributeKind -
attributeName
-
attributePairIndex
private int attributePairIndex -
declaredBy
-
-
Constructor Details
-
Method
public Method(CompoundType enclosing, MemberDefinition memberDef, boolean quiet, ContextStack stack) throws Exception Create a new Method object corresponding to the given method definition.- Throws:
Exception
-
-
Method Details
-
isInherited
public boolean isInherited()Is this method inherited? -
isAttribute
public boolean isAttribute()Is this method an attribute? Return true if getAttributeKind != ATTRIBUTE_NONE. -
isReadWriteAttribute
public boolean isReadWriteAttribute()Is this method a read-write attribute? -
getAttributeKind
public int getAttributeKind()Return the attribute kind. -
getAttributeName
Return the attribute name. Will be null if attribute kind == ATTRIBUTE_NONE. -
getAttributePairIndex
public int getAttributePairIndex()For kinds ATTRIBUTE_GET_RW or ATTRIBUTE_IS_RW, return the index of the matching ATTRIBUTE_SET method, and vice-versa. For all other cases, return -1. -
getElementName
Return context element name.- Specified by:
getElementName
in interfaceContextElement
-
equals
Equality check based on method signature. -
hashCode
public int hashCode() -
mergeWith
Return a new Method object that is a legal combination of this method object and another one. This requires determining the exceptions declared by the combined method, which must be only those exceptions that may thrown by both of the old methods. -
collectCompatibleExceptions
private void collectCompatibleExceptions(ValueType[] from, ValueType[] with, Vector<ValueType> list) throws ClassNotFound Add to the supplied list all exceptions in the "from" array that are subclasses of an exception in the "with" array.- Throws:
ClassNotFound
-
getEnclosing
Return the compound type which contains this method. -
getDeclaredBy
Return the identifier for the class or interface which declares this method. -
getVisibility
Return the visibility (e.g. "public final") of this member. -
isPublic
public boolean isPublic()Methods to check various attributes. -
isProtected
public boolean isProtected() -
isPrivate
public boolean isPrivate() -
isStatic
public boolean isStatic() -
getName
Return the name of this method. -
getIDLName
IDL_Naming Return the IDL name of this method. -
getType
Return the type of this method. -
isConstructor
public boolean isConstructor()Return true if this is a constructor. -
isNormalMethod
public boolean isNormalMethod()Return true if this is NOT a constructor&&
is not an attribute. -
getReturnType
Get the return type of this method. May be null. -
getArguments
Return the argument types of this method. -
getArgumentNames
Return the names of the argument types of this method. -
getMemberDefinition
Return the MemberDefinition from which this method was created. -
getExceptions
Return an array of the exception classes declared to be thrown by this remote method. For methods with the same name and type signature inherited from multiple remote interfaces, the array will contain the set of exceptions declared in all of the interfaces' methods that can be legally thrown in each of them. -
getImplExceptions
Same as getExceptions(), except when method is in an ImplementationType and the exceptions list is narrower. -
getUniqueCatchList
Return an array containing only those exceptions which need to be caught. Removes java.rmi.RemoteException, java.lang.RuntimeException, java.lang.Error, and their subclasses, then removes any exceptions which are more derived than another in the list. Returns null if no exceptions need to be caught. -
getFilteredStubExceptions
Return an array containing only those exceptions which need to be handled explicitly by the stub. Removes java.lang.RuntimeException, java.lang.Error, and their subclasses, since these are all passed back as CORBA system exceptions. Also removes subclasses of java.rmi.RemoteException but not java.rmi.RemoteException itself, since this may need to be thrown by the stub. -
toString
Return the string representation of this method. -
setAttributeKind
public void setAttributeKind(int kind) Set attribute kind. May only be called during initialization. -
setAttributePairIndex
public void setAttributePairIndex(int index) Set pair index. May only be called during initialization. -
setAttributeName
Set attribute name. May only be called during initialization. -
setIDLName
Set the idl name. May only be called during initialization. -
setImplExceptions
Set the implExceptions array. May only be called during initialization. -
setDeclaredBy
Set the declaredBy Identifier. May only be called during initialization. -
swapInvalidTypes
protected void swapInvalidTypes()Convert all invalid types to valid ones. -
destroy
public void destroy()Release all resources. -
makeArgName
Make up an argument name for the given type. -
clone
Cloning is supported by returning a shallow copy of this object.
-