コード例 #1
0
        public AnnotationValueBuilder addAnnotationArgument(TypeInfo type, bool runtimeVisible)
        {
            var result = new AnnotationValueBuilder(type, runtimeVisible);

            elements.add(result);
            return(result);
        }
コード例 #2
0
        public AnnotationValueBuilder setAnnotationArgument(String name, TypeInfo type, bool runtimeVisible)
        {
            var result = new AnnotationValueBuilder(type, runtimeVisible);

            arguments[name] = result;
            return(result);
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
        public AnnotationValueBuilder addAnnotation(TypeInfo type, bool runtimeVisible)
        {
            method.checkCreated();
            var result = new AnnotationValueBuilder(type, runtimeVisible);

            annotations.add(result);
            return(result);
        }
コード例 #5
0
        private ArrayList <AnnotationValue> buildAnnotationValues(ArrayList <RawAnnotationValue> annotations)
        {
            var result = new ArrayList <AnnotationValue>();

            foreach (var av in annotations)
            {
                var b = new AnnotationValueBuilder(getTypeInfo(av.Type), av.IsRuntimeVisible);
                buildAnnotationArgument(b, av);
                result.add(b);
            }
            return(result);
        }
コード例 #6
0
 public AnnotationValueBuilder addAnnotation(TypeInfo type, bool runtimeVisible) {
     checkCreated();
     var result = new AnnotationValueBuilder(type, runtimeVisible);
     annotations.add(result);
     return result;
 }
コード例 #7
0
 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;
     }
 }
コード例 #8
0
 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;
         }
     }
 }
コード例 #9
0
 private ArrayList<AnnotationValue> buildAnnotationValues(ArrayList<RawAnnotationValue> annotations) {
     var result = new ArrayList<AnnotationValue>();
     foreach (var av in annotations) {
         var b = new AnnotationValueBuilder(getTypeInfo(av.Type), av.IsRuntimeVisible);
         buildAnnotationArgument(b, av);
         result.add(b);
     }
     return result;
 }
コード例 #10
0
		private static void cloneAnnotationValue(AnnotationValue value, Library targetTypeSystem,
				AnnotationValueBuilder builder, Scope<String, TypeInfo> genericArgs) {
			foreach (var s in value.ArgumentNames) {
				var a = value.getArgument(s);
				switch (a.AnnotationArgumentKind) {
				case Annotation:
					cloneAnnotationValue((AnnotationValue)a, targetTypeSystem,
							builder.setAnnotationArgument(s, a.Type, a.IsRuntimeVisible), genericArgs);
					break;
				case Array:
					var aab = builder.setArrayArgument(s);
					foreach (var aa in a.Elements) {
						cloneAnnotationArgument(aa, targetTypeSystem, aab, genericArgs);
					}
					break;
				case Boolean:
					builder.setBooleanArgument(s, (Boolean)a.Value);
					break;
				case Byte:
					builder.setByteArgument(s, (Byte)a.Value);
					break;
				case Char:
					builder.setCharArgument(s, (Character)a.Value);
					break;
				case Double:
					builder.setDoubleArgument(s, (Double)a.Value);
					break;
				case Enum:
					builder.setEnumArgument(s, a.getType(), a.Name);
					break;
				case Float:
					builder.setFloatArgument(s, (Float)a.Value);
					break;
				case Int:
					builder.setIntArgument(s, (Integer)a.Value);
					break;
				case Long:
					builder.setLongArgument(s, (Long)a.Value);
					break;
				case Short:
					builder.setShortArgument(s, (Short)a.Value);
					break;
				case String:
					builder.setStringArgument(s, (String)a.Value);
					break;
				case Type:
					builder.setTypeArgument(s, a.Type);
					break;
				}
			}
		}
コード例 #11
0
        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;
                }
            }
        }
コード例 #12
0
 public AnnotationValueBuilder setAnnotationArgument(String name, TypeInfo type, bool runtimeVisible) {
     var result = new AnnotationValueBuilder(type, runtimeVisible);
     arguments[name] = result;
     return result;
 }
コード例 #13
0
 public AnnotationValueBuilder addAnnotationArgument(TypeInfo type, bool runtimeVisible) {
     var result = new AnnotationValueBuilder(type, runtimeVisible);
     elements.add(result);
     return result;
 }