Class IDLTypesUtil
- java.lang.Object
-
- com.sun.corba.ee.impl.presentation.rmi.IDLTypesUtil
-
public final class IDLTypesUtil extends java.lang.ObjectUtility class for testing RMI/IDL Types as defined in Section 1.2 of The Java Language to IDL Mapping. Note that these are static checks only. Runtime checks, such as those described in Section 1.2.3, #3, are not covered.
-
-
Field Summary
Fields Modifier and Type Field Description static booleanFOLLOW_RMICprivate static java.lang.StringGET_PROPERTY_PREFIXstatic intINVALID_TYPEprivate static java.lang.StringIS_PROPERTY_PREFIXprivate static java.lang.StringSET_PROPERTY_PREFIXstatic intVALID_TYPE
-
Constructor Summary
Constructors Constructor Description IDLTypesUtil()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAttributeNameForProperty(java.lang.String propertyName)IDLTypegetPrimitiveIDLTypeMapping(java.lang.Class c)Return IDL Type name for primitive types as defined in Section 1.3.3 of Java2IDL spec or null if not a primitive type.IDLTypegetSpecialCaseIDLTypeMapping(java.lang.Class c)Return IDL Type name for special case type mappings as defined in Table 1-1 of Java2IDL spec or null if given class is not a special type.private booleanhasCorrespondingReadProperty(java.lang.reflect.Method writeProperty, java.lang.Class c, java.lang.String readPropertyPrefix)booleanisArray(java.lang.Class c)booleanisCheckedException(java.lang.Class c)booleanisEntity(java.lang.Class c)Section 1.2.8 Checks if a class is assignable toIDLEntitybooleanisException(java.lang.Class c)Section 1.2.6 Checks if a class is anExceptionprivate booleanisHasCorrespondingReadProperty(java.lang.reflect.Method readProperty, java.lang.Class c)booleanisObjectReference(java.lang.Class c)Section 1.2.7 If the class is a CORBAObjectbooleanisPrimitive(java.lang.Class c)Section 1.2.2 Primitive Types Checks if a class is a primitive typebooleanisPropertyAccessorMethod(java.lang.reflect.Method method, java.lang.Class clazz)Return true if given method is legal property accessor as defined in Section 1.3.4.3 of Java2IDL spec.booleanisRemoteException(java.lang.Class c)private booleanisRemoteExceptionOrSuperClass(java.lang.Class c)Implements Section 1.2.3, #2.booleanisRemoteInterface(java.lang.Class c)Checks if a class if a valid Java RMI/IIOP interfacebooleanisValue(java.lang.Class c)Section 1.2.4 Checks if a class is aSerializablevalueprivate booleanreadHasCorrespondingIsProperty(java.lang.reflect.Method readProperty, java.lang.Class c)private voidvalidateConstants(java.lang.Class c)Implements 1.2.3 #6private voidvalidateDirectInterfaces(java.lang.Class c)Implements Section 1.2.3, #5.private voidvalidateExceptions(java.lang.reflect.Method method)Implements 1.2.3 #2 and #4voidvalidateRemoteInterface(java.lang.Class c)Validate a class to ensure it conforms to the rules for a Java RMI/IIOP interface.private booleanvalidPropertyExceptions(java.lang.reflect.Method method)Returns true if the method's throw clause conforms to the exception restrictions for properties as defined in Section 1.3.4.3 of Java2IDL spec.
-
-
-
Field Detail
-
GET_PROPERTY_PREFIX
private static final java.lang.String GET_PROPERTY_PREFIX
- See Also:
- Constant Field Values
-
SET_PROPERTY_PREFIX
private static final java.lang.String SET_PROPERTY_PREFIX
- See Also:
- Constant Field Values
-
IS_PROPERTY_PREFIX
private static final java.lang.String IS_PROPERTY_PREFIX
- See Also:
- Constant Field Values
-
VALID_TYPE
public static final int VALID_TYPE
- See Also:
- Constant Field Values
-
INVALID_TYPE
public static final int INVALID_TYPE
- See Also:
- Constant Field Values
-
FOLLOW_RMIC
public static final boolean FOLLOW_RMIC
- See Also:
- Constant Field Values
-
-
Method Detail
-
validateRemoteInterface
public void validateRemoteInterface(java.lang.Class c) throws IDLTypeExceptionValidate a class to ensure it conforms to the rules for a Java RMI/IIOP interface.- Parameters:
c- Class to validate- Throws:
IDLTypeException- if not a valid RMI/IIOP interface.
-
isRemoteInterface
public boolean isRemoteInterface(java.lang.Class c)
Checks if a class if a valid Java RMI/IIOP interface- Parameters:
c- Class to check- Returns:
- If it is a remote interface
-
isPrimitive
public boolean isPrimitive(java.lang.Class c)
Section 1.2.2 Primitive Types Checks if a class is a primitive type- Parameters:
c- Class to check- Returns:
- If the class is a primitive type.
- See Also:
Class.isPrimitive()
-
isValue
public boolean isValue(java.lang.Class c)
Section 1.2.4 Checks if a class is aSerializablevalue- Parameters:
c- class to check- Returns:
- if the class is Serializable
-
isArray
public boolean isArray(java.lang.Class c)
Section 1.2.5 Checks if a class is an array of a primitive, Remote Interface,IDLEntity,Exception,Serializablevalue or CORBAObject.- Parameters:
c- Class to check- Returns:
- If the class is an array
-
isException
public boolean isException(java.lang.Class c)
Section 1.2.6 Checks if a class is anException- Parameters:
c- Class to check if it is an exception.- Returns:
- True if a subclass of
Exception
-
isRemoteException
public boolean isRemoteException(java.lang.Class c)
-
isCheckedException
public boolean isCheckedException(java.lang.Class c)
-
isObjectReference
public boolean isObjectReference(java.lang.Class c)
Section 1.2.7 If the class is a CORBAObject- Parameters:
c- class to check if it is a CORBA Object- Returns:
- if it is an object.
-
isEntity
public boolean isEntity(java.lang.Class c)
Section 1.2.8 Checks if a class is assignable toIDLEntity- Parameters:
c- Class to check if it is an entity- Returns:
- if the class is an entity.
-
isPropertyAccessorMethod
public boolean isPropertyAccessorMethod(java.lang.reflect.Method method, java.lang.Class clazz)Return true if given method is legal property accessor as defined in Section 1.3.4.3 of Java2IDL spec.- Parameters:
method- Method to checkclazz- Class containing method- Returns:
- If method if a legal accessor.
-
hasCorrespondingReadProperty
private boolean hasCorrespondingReadProperty(java.lang.reflect.Method writeProperty, java.lang.Class c, java.lang.String readPropertyPrefix)
-
readHasCorrespondingIsProperty
private boolean readHasCorrespondingIsProperty(java.lang.reflect.Method readProperty, java.lang.Class c)
-
isHasCorrespondingReadProperty
private boolean isHasCorrespondingReadProperty(java.lang.reflect.Method readProperty, java.lang.Class c)
-
getAttributeNameForProperty
public java.lang.String getAttributeNameForProperty(java.lang.String propertyName)
-
getPrimitiveIDLTypeMapping
public IDLType getPrimitiveIDLTypeMapping(java.lang.Class c)
Return IDL Type name for primitive types as defined in Section 1.3.3 of Java2IDL spec or null if not a primitive type.- Parameters:
c- the class to get the mapping for- Returns:
- the IDLType of the primitive, or
nullif the class is not a primitive.
-
getSpecialCaseIDLTypeMapping
public IDLType getSpecialCaseIDLTypeMapping(java.lang.Class c)
Return IDL Type name for special case type mappings as defined in Table 1-1 of Java2IDL spec or null if given class is not a special type.- Parameters:
c- class to get special case mapping for- Returns:
- The IDLType for the special case, or
nullif it is not a special case.
-
validateExceptions
private void validateExceptions(java.lang.reflect.Method method) throws IDLTypeExceptionImplements 1.2.3 #2 and #4- Throws:
IDLTypeException
-
validPropertyExceptions
private boolean validPropertyExceptions(java.lang.reflect.Method method)
Returns true if the method's throw clause conforms to the exception restrictions for properties as defined in Section 1.3.4.3 of Java2IDL spec. This means that for all exceptions E declared on the method, E isChecked => RemoteException.isAssignableFrom( E ).
-
isRemoteExceptionOrSuperClass
private boolean isRemoteExceptionOrSuperClass(java.lang.Class c)
Implements Section 1.2.3, #2.
-
validateDirectInterfaces
private void validateDirectInterfaces(java.lang.Class c) throws IDLTypeExceptionImplements Section 1.2.3, #5.- Throws:
IDLTypeException
-
validateConstants
private void validateConstants(java.lang.Class c) throws IDLTypeExceptionImplements 1.2.3 #6- Throws:
IDLTypeException
-
-