/** * Section 1.2.6 */ public boolean isException(Class<?> c) { if (c == null) { throw new IllegalArgumentException(); } // Must be a checked exception, not including RemoteException or // its subclasses. return isCheckedException(c) && !isRemoteException(c) && isValue(c); }
/** * Section 1.2.5 */ public boolean isArray(Class<?> c) { boolean arrayType = false; if (c == null) { throw new IllegalArgumentException(); } if (c.isArray()) { Class<?> componentType = c.getComponentType(); arrayType = (isPrimitive(componentType) || isRemoteInterface(componentType) || isEntity(componentType) || isException(componentType) || isValue(componentType) || isObjectReference(componentType)); } return arrayType; }
/** * 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 ). */ private boolean validPropertyExceptions(Method method) { Class<?>[] exceptions = method.getExceptionTypes(); for (int eIndex = 0; eIndex < exceptions.length; eIndex++) { Class<?> exception = exceptions[eIndex]; if (isCheckedException(exception) && !isRemoteException(exception)) return false; } return true; }
IDLTypesUtil idlTypesUtil = new IDLTypesUtil(); if (idlTypesUtil.isPrimitive(c)) idlType = idlTypesUtil.getPrimitiveIDLTypeMapping(c); idlType = idlTypesUtil.getSpecialCaseIDLTypeMapping(c); if (idlTypesUtil.isEntity(c))
if (isRemoteExceptionOrSuperClass(exception)) if (isCheckedException(exception) && !isValue(exception) && !isRemoteException(exception))
if ((parameters.length == 0) && (returnType != Void.TYPE) && !readHasCorrespondingIsProperty(m, c)) if (hasCorrespondingReadProperty(m, c, GET_PROPERTY_PREFIX) || hasCorrespondingReadProperty(m, c, IS_PROPERTY_PREFIX)) if ((parameters.length == 0) && (returnType == Boolean.TYPE) && !isHasCorrespondingReadProperty(m, c)) if (!validPropertyExceptions(m) || (methodName.length() <= propertyType.length()))
IDLTypesUtil idlTypesUtil = new IDLTypesUtil(); if (!idlTypesUtil.isPrimitive(nextParamType) && (idlTypesUtil.getSpecialCaseIDLTypeMapping(nextParamType) == null) && isIDLKeyword(typeName))
IDLTypesUtil idlTypesUtil = new IDLTypesUtil(); final Method[] methods = interf.getMethods(); if (idlTypesUtil.isPropertyAccessorMethod(nextMethod, interf)) String attributeName = idlTypesUtil.getAttributeNameForProperty(nextMethod.getName()); methodInfo.originalName = attributeName; methodInfo.mangledName = attributeName;
/** * Initialize an IDLNameTranslator for the given interface. * * @throws IllegalStateException * if given class is not a valid RMI/IIOP Remote Interface */ private IDLNameTranslatorImpl(Class<?>[] interfaces) { SecurityManager s = System.getSecurityManager(); if (s != null) { s.checkPermission(new DynamicAccessPermission("access")); } try { IDLTypesUtil idlTypesUtil = new IDLTypesUtil(); for (int ctr = 0; ctr < interfaces.length; ctr++) idlTypesUtil.validateRemoteInterface(interfaces[ctr]); interf_ = interfaces; buildNameTranslation(); } catch (IDLTypeException ite) { String msg = ite.getMessage(); IllegalStateException ise = new IllegalStateException(msg); ise.initCause(ite); throw ise; } }
IDLTypesUtil idlTypesUtil = new IDLTypesUtil(); if (idlTypesUtil.isPrimitive(c)) idlType = idlTypesUtil.getPrimitiveIDLTypeMapping(c); idlType = idlTypesUtil.getSpecialCaseIDLTypeMapping(c); if (idlTypesUtil.isEntity(c))
if (isRemoteExceptionOrSuperClass(exception)) if (isCheckedException(exception) && !isValue(exception) && !isRemoteException(exception))
if ((parameters.length == 0) && (returnType != Void.TYPE) && !readHasCorrespondingIsProperty(m, c)) if (hasCorrespondingReadProperty(m, c, GET_PROPERTY_PREFIX) || hasCorrespondingReadProperty(m, c, IS_PROPERTY_PREFIX)) if ((parameters.length == 0) && (returnType == Boolean.TYPE) && !isHasCorrespondingReadProperty(m, c)) if (!validPropertyExceptions(m) || (methodName.length() <= propertyType.length()))
IDLTypesUtil idlTypesUtil = new IDLTypesUtil(); if (!idlTypesUtil.isPrimitive(nextParamType) && (idlTypesUtil.getSpecialCaseIDLTypeMapping(nextParamType) == null) && isIDLKeyword(typeName))
IDLTypesUtil idlTypesUtil = new IDLTypesUtil(); final Method[] methods = interf.getMethods(); if (idlTypesUtil.isPropertyAccessorMethod(nextMethod, interf)) String attributeName = idlTypesUtil.getAttributeNameForProperty(nextMethod.getName()); methodInfo.originalName = attributeName; methodInfo.mangledName = attributeName;
/** * 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 ). */ private boolean validPropertyExceptions(Method method) { Class<?>[] exceptions = method.getExceptionTypes(); for (int eIndex = 0; eIndex < exceptions.length; eIndex++) { Class<?> exception = exceptions[eIndex]; if (isCheckedException(exception) && !isRemoteException(exception)) return false; } return true; }
/** * Initialize an IDLNameTranslator for the given interface. * * @throws IllegalStateException * if given class is not a valid RMI/IIOP Remote Interface */ private IDLNameTranslatorImpl(Class<?>[] interfaces) { SecurityManager s = System.getSecurityManager(); if (s != null) { s.checkPermission(new DynamicAccessPermission("access")); } try { IDLTypesUtil idlTypesUtil = new IDLTypesUtil(); for (int ctr = 0; ctr < interfaces.length; ctr++) idlTypesUtil.validateRemoteInterface(interfaces[ctr]); interf_ = interfaces; buildNameTranslation(); } catch (IDLTypeException ite) { String msg = ite.getMessage(); IllegalStateException ise = new IllegalStateException(msg); ise.initCause(ite); throw ise; } }
/** * Section 1.2.5 */ public boolean isArray(Class<?> c) { boolean arrayType = false; if (c == null) { throw new IllegalArgumentException(); } if (c.isArray()) { Class<?> componentType = c.getComponentType(); arrayType = (isPrimitive(componentType) || isRemoteInterface(componentType) || isEntity(componentType) || isException(componentType) || isValue(componentType) || isObjectReference(componentType)); } return arrayType; }
/** * Section 1.2.6 */ public boolean isException(Class<?> c) { if (c == null) { throw new IllegalArgumentException(); } // Must be a checked exception, not including RemoteException or // its subclasses. return isCheckedException(c) && !isRemoteException(c) && isValue(c); }