switch (getPrimitiveType((PrimitiveType) type)) { case VOID : case BYTE :
/** * Generates the declaration code required to the deserialization of the * variable whoes name is <code>varName</code> and its type is * <code>varType</code>. The returned object will be passed as * <code>context</code> parameter to the call of the * {@link #writeSerialization(Type, String, String, CodeWriter, Object, boolean) writeSerialization} * method for the same variable. * * @param varType the type of the variable to serialize. * @param varName the name of the variable to serialize. * @param cw the {@link CodeWriter} into which the generated code is appended. * @param validator the name validator. Can be used to validate a local * variable name. * @return an object that will be passed as <code>context</code> parameter * to the call of the * {@link #writeSerialization(Type, String, String, CodeWriter, Object, boolean) writeSerialization} * method for the same variable. */ public static Object writeDeserializationDeclaration(final Type varType, final String varName, final CodeWriter cw, final VarNameValidator validator) { if (varType instanceof PrimitiveType) { return writeDeserializationDeclaration( getPrimitiveType((PrimitiveType) varType), varName, cw, validator); } if (isPointerToArray(varType)) { return null; } throw new IllegalArgumentException("Invalid varType"); }
/** * Generates the declaration code required to the serialization of the * variable whose name is <code>varName</code> and its type is * <code>varType</code>. The returned object will be passed as * <code>context</code> parameter to the call of the * {@link #writeSerialization(Type, String, String, CodeWriter, Object, boolean) writeSerialization} * method for the same variable. * * @param varType the type of the variable to serialize. * @param varName the name of the variable to serialize. * @param cw the {@link CodeWriter} into which the generated code is appended. * @param validator the name validator. Can be used to validate a local * variable name. * @return an object that will be passed as <code>context</code> parameter * to the call of the * {@link #writeSerialization(Type, String, String, CodeWriter, Object, boolean) writeSerialization} * method for the same variable. */ public static Object writeSerializationDeclaration(final Type varType, final String varName, final CodeWriter cw, final VarNameValidator validator) { if (varType instanceof PrimitiveType) { return writeSerializationDeclaration( getPrimitiveType((PrimitiveType) varType), varName, cw, validator); } if (isPointerToArray(varType)) { return null; } throw new IllegalArgumentException("Invalid varType"); }
if (!isPointerToArray(type)) { boolean pointer = false; pointer |= ((type instanceof PrimitiveType) && (getPrimitiveType((PrimitiveType) type) == PrimitiveTypeEnum.STRING)); pointer |= (type instanceof PointerOf); pointer |= (type instanceof ArrayOf);
if (!isPointerToArray(type)) { boolean pointer = false; pointer |= ((type instanceof PrimitiveType) && (getPrimitiveType((PrimitiveType) type) == PrimitiveTypeEnum.STRING)); pointer |= (type instanceof PointerOf); pointer |= (type instanceof ArrayOf);
public void visitMethod(final Method method) throws Exception { final Type returnType = Util.getContainedType((method)); final boolean isVoidMethod = (returnType instanceof PrimitiveType) && getPrimitiveType((PrimitiveType) returnType) == PrimitiveTypeEnum.VOID;
&& (getPrimitiveType((PrimitiveType) type) == PrimitiveTypeEnum.STRING)) {
&& (getPrimitiveType((PrimitiveType) type) == PrimitiveTypeEnum.STRING)) {
@Override protected void checkRemoteInterface( final RemoteInterfaceDefinition definition, final Map<Object, Object> context) throws ADLException { for (final Method m : ((MethodContainer) definition).getMethods()) { final Type returnType = Util.getContainedType((m)); /* The method must return void */ final boolean isVoidMethod = (returnType instanceof PrimitiveType) && getPrimitiveType((PrimitiveType) returnType) == PrimitiveTypeEnum.VOID; if (!isVoidMethod) throw new ADLException(EXBErrors.IDL_INVALID_TYPE, "Each method in MP stubs and skeletons must return void"); ; /* Each parameter must be serializable and must not be in or in/out */ for (final Parameter p : ((ParameterContainer) m).getParameters()) { final Type paramType = Util.getContainedType((p)); if (!isSerializable(paramType)) throw new ADLException(EXBErrors.IDL_INVALID_TYPE, "The type of the parameter '" + p.getName() + "' is not serializable", paramType); if (Util.isOutParameter(p) || Util.isInOutParameter(p)) throw new ADLException(EXBErrors.IDL_INVALID_TYPE, "The parameter '" + p.getName() + "' must be IN", paramType); } } } }
.getParameters(); final boolean isVoidMethod = (returnType instanceof PrimitiveType) && getPrimitiveType((PrimitiveType) returnType) == PrimitiveTypeEnum.VOID; final Map<Parameter, Object> paramContext = new HashMap<Parameter, Object>(); final Object resultContext = null;
.getParameters(); final boolean isVoidMethod = (returnType instanceof PrimitiveType) && getPrimitiveType((PrimitiveType) returnType) == PrimitiveTypeEnum.VOID; final Map<Parameter, Object> paramContext = new HashMap<Parameter, Object>();
final String sizeofName, final CodeWriter cw, final Object context) { if (varType instanceof PrimitiveType) { writeSizeOf(getPrimitiveType((PrimitiveType) varType), varName, sizeofName, cw, context); return;
&& (getPrimitiveType((PrimitiveType) type) == PrimitiveTypeEnum.STRING)) { code_cw.appendln("if(" + p.getName() + ")"); code_cw.appendln("{");
.getParameters(); final boolean isVoidMethod = (returnType instanceof PrimitiveType) && getPrimitiveType((PrimitiveType) returnType) == PrimitiveTypeEnum.VOID; final Map<Parameter, Object> paramContext = new HashMap<Parameter, Object>(); Object resultContext = null;
.getParameters(); final boolean isVoidMethod = (returnType instanceof PrimitiveType) && getPrimitiveType((PrimitiveType) returnType) == PrimitiveTypeEnum.VOID; final Map<Parameter, Object> paramContext = new HashMap<Parameter, Object>(); final Map<Parameter, Object> outParamContext = new HashMap<Parameter, Object>();
final Object context, final boolean free) { if (varType instanceof PrimitiveType) { writeSerialization(getPrimitiveType((PrimitiveType) varType), varName, buffName, cw, context, free); return;
final Object context, final boolean alloc) { if (varType instanceof PrimitiveType) { writeDeserialization(getPrimitiveType((PrimitiveType) varType), varName, buffName, cw, context, alloc); return;