private AnnotationArgument buildAnnotationArrayElement(RawAnnotationArgument arg) { switch (arg.AnnotationArgumentKind) { case Boolean: case Byte: case Char: case Short: case Int: case Long: case Float: case Double: case String: return(new SimpleAnnotationArgument(arg.AnnotationArgumentKind, arg.Value)); case Enum: return(new EnumAnnotationArgument(getTypeInfo(arg.Type), arg.Name)); case Type: return(new TypeAnnotationArgument(getTypeInfo(arg.Type))); case Array: var ab = new AnnotationArrayValueBuilder(); foreach (var e in arg.Elements) { buildAnnotationArrayElement(ab, e); } return(ab); default: var vb = new AnnotationValueBuilder(getTypeInfo(arg.Type), arg.IsRuntimeVisible); buildAnnotationArgument(vb, arg); return(vb); } }
private void buildAnnotationArrayElement(AnnotationArrayValueBuilder b, RawAnnotationArgument arg) { switch (arg.AnnotationArgumentKind) { case Boolean: b.addBooleanArgument((Boolean)arg.Value); break; case Byte: b.addByteArgument((Byte)arg.Value); break; case Char: b.addCharArgument((Character)arg.Value); break; case Short: b.addShortArgument((Short)arg.Value); break; case Int: b.addIntArgument((Integer)arg.Value); break; case Long: b.addLongArgument((Long)arg.Value); break; case Float: b.addFloatArgument((Float)arg.Value); break; case Double: b.addDoubleArgument((Double)arg.Value); break; case String: b.addStringArgument((String)arg.Value); break; case Enum: b.addEnumArgument(getTypeInfo(arg.Type), arg.Name); break; case Type: b.addTypeArgument(getTypeInfo(arg.Type)); break; case Array: var ab = b.addArrayArgument(); foreach (var e in arg.Elements) { buildAnnotationArrayElement(ab, e); } break; default: var vb = b.addAnnotationArgument(getTypeInfo(arg.Type), arg.IsRuntimeVisible); buildAnnotationArgument(vb, arg); break; } }
private AnnotationArgument buildAnnotationArrayElement(RawAnnotationArgument arg) { switch (arg.AnnotationArgumentKind) { case Boolean: case Byte: case Char: case Short: case Int: case Long: case Float: case Double: case String: return new SimpleAnnotationArgument(arg.AnnotationArgumentKind, arg.Value); case Enum: return new EnumAnnotationArgument(getTypeInfo(arg.Type), arg.Name); case Type: return new TypeAnnotationArgument(getTypeInfo(arg.Type)); case Array: var ab = new AnnotationArrayValueBuilder(); foreach (var e in arg.Elements) { buildAnnotationArrayElement(ab, e); } return ab; default: var vb = new AnnotationValueBuilder(getTypeInfo(arg.Type), arg.IsRuntimeVisible); buildAnnotationArgument(vb, arg); return vb; } }
private void buildAnnotationArgument(AnnotationValueBuilder b, RawAnnotationArgument RawAnnotation) { foreach (var s in RawAnnotation.ArgumentNames) { var arg = RawAnnotation.getArgument(s); switch (arg.AnnotationArgumentKind) { case Boolean: b.setBooleanArgument(s, (Boolean)arg.Value); break; case Byte: b.setByteArgument(s, (Byte)arg.Value); break; case Char: b.setCharArgument(s, (Character)arg.Value); break; case Short: b.setShortArgument(s, (Short)arg.Value); break; case Int: b.setIntArgument(s, (Integer)arg.Value); break; case Long: b.setLongArgument(s, (Long)arg.Value); break; case Float: b.setFloatArgument(s, (Float)arg.Value); break; case Double: b.setDoubleArgument(s, (Double)arg.Value); break; case String: b.setStringArgument(s, (String)arg.Value); break; case Enum: b.setEnumArgument(s, getTypeInfo(arg.Type), arg.Name); break; case Type: b.setTypeArgument(s, getTypeInfo(arg.Type)); break; case Array: var ab = b.setArrayArgument(s); foreach (var e in arg.Elements) { buildAnnotationArrayElement(ab, e); } break; default: var vb = b.setAnnotationArgument(s, getTypeInfo(arg.Type), arg.IsRuntimeVisible); buildAnnotationArgument(vb, arg); break; } } }