/** * Visits a primitive value of the annotation. * * @param name the value name. * @param value the actual value, whose type must be {@link Byte}, {@link Boolean}, {@link * Character}, {@link Short}, {@link Integer} , {@link Long}, {@link Float}, {@link Double}, * {@link String} or {@link Type} of {@link Type#OBJECT} or {@link Type#ARRAY} sort. This * value can also be an array of byte, boolean, short, char, int, long, float or double values * (this is equivalent to using {@link #visitArray} and visiting each array element in turn, * but is more convenient). */ public void visit(final String name, final Object value) { if (av != null) { av.visit(name, value); } }
av.visit(name, value);
byte[] b = (byte[]) value; for (int i = 0; i < b.length; i++) { av.visit(null, b[i]); char[] b = (char[]) value; for (int i = 0; i < b.length; i++) { av.visit(null, b[i]); short[] b = (short[]) value; for (int i = 0; i < b.length; i++) { av.visit(null, b[i]); boolean[] b = (boolean[]) value; for (int i = 0; i < b.length; i++) { av.visit(null, Boolean.valueOf(b[i])); int[] b = (int[]) value; for (int i = 0; i < b.length; i++) { av.visit(null, b[i]); long[] b = (long[]) value; for (int i = 0; i < b.length; i++) { av.visit(null, b[i]); float[] b = (float[]) value; for (int i = 0; i < b.length; i++) { av.visit(null, b[i]); double[] b = (double[]) value;
Object[] array = (Object[]) apv.getValue(); for (Object o : array) { subAv.visit(null,o); av.visit(apv.getProperty(),apv.getValue()); break; case ENUMARRAY: Class[] klarray = (Class[]) apv.getValue(); for (Class klass : klarray) { subKlav.visit(null,Type.getType("L"+BuildUtils.getInternalType(klass.getName())+";")); case KLASS: String klassName = BuildUtils.getInternalType(((Class) apv.getValue()).getName()); av.visit(apv.getProperty(),Type.getType("L"+klassName+";")); break; case PRIMITIVE: av.visit(apv.getProperty(),apv.getValue()); break; case STRING: av.visit(apv.getProperty(),apv.getValue()); break;
/** * Visits a primitive value of the annotation. * * @param name * the value name. * @param value * the actual value, whose type must be {@link Byte}, * {@link Boolean}, {@link Character}, {@link Short}, * {@link Integer} , {@link Long}, {@link Float}, {@link Double}, * {@link String} or {@link Type} of OBJECT or ARRAY sort. This * value can also be an array of byte, boolean, short, char, int, * long, float or double values (this is equivalent to using * {@link #visitArray visitArray} and visiting each array element * in turn, but is more convenient). */ public void visit(String name, Object value) { if (av != null) { av.visit(name, value); } }
Object[] array = (Object[]) apv.getValue(); for (Object o : array) { subAv.visit(null,o); av.visit(apv.getProperty(),apv.getValue()); break; case ENUMARRAY: Class[] klarray = (Class[]) apv.getValue(); for (Class klass : klarray) { subKlav.visit(null,Type.getType("L"+BuildUtils.getInternalType(klass.getName())+";")); case KLASS: String klassName = BuildUtils.getInternalType(((Class) apv.getValue()).getName()); av.visit(apv.getProperty(),Type.getType("L"+klassName+";")); break; case PRIMITIVE: av.visit(apv.getProperty(),apv.getValue()); break; case STRING: av.visit(apv.getProperty(),apv.getValue()); break;
@Override public void visit(final String name, final Object value) { p.visit(name, value); super.visit(name, value); }
case 'F': // pointer to CONSTANT_Float case 'D': // pointer to CONSTANT_Double av.visit(name, readConst(readUnsignedShort(v), buf)); v += 2; break; case 'B': // pointer to CONSTANT_Byte av.visit(name, new Byte((byte) readInt(items[readUnsignedShort(v)]))); v += 2; break; case 'Z': // pointer to CONSTANT_Boolean av.visit(name, readInt(items[readUnsignedShort(v)]) == 0 ? Boolean.FALSE : Boolean.TRUE); break; case 'S': // pointer to CONSTANT_Short av.visit(name, new Short((short) readInt(items[readUnsignedShort(v)]))); v += 2; break; case 'C': // pointer to CONSTANT_Char av.visit(name, new Character((char) readInt(items[readUnsignedShort(v)]))); v += 2; break; case 's': // pointer to CONSTANT_Utf8 av.visit(name, readUTF8(v, buf)); v += 2;
@Override public void visit(String name, Object value) { av.visit(name, remapper.mapValue(value)); }
case 'F': // pointer to CONSTANT_Float case 'D': // pointer to CONSTANT_Double av.visit(name, readConst(readUnsignedShort(v), buf)); v += 2; break; case 'B': // pointer to CONSTANT_Byte av.visit(name, (byte) readInt(items[readUnsignedShort(v)])); v += 2; break; case 'Z': // pointer to CONSTANT_Boolean av.visit(name, readInt(items[readUnsignedShort(v)]) == 0 ? Boolean.FALSE : Boolean.TRUE); break; case 'S': // pointer to CONSTANT_Short av.visit(name, (short) readInt(items[readUnsignedShort(v)])); v += 2; break; case 'C': // pointer to CONSTANT_Char av.visit(name, (char) readInt(items[readUnsignedShort(v)])); v += 2; break; case 's': // pointer to CONSTANT_Utf8 av.visit(name, readUTF8(v, buf)); v += 2; break; break;
@Override public void visit(String name, Object value) { av.visit(name, remapper.mapValue(value)); }
annotationVisitor.visit( elementName, (byte) readInt(cpInfoOffsets[readUnsignedShort(currentOffset)])); currentOffset += 2; break; case 'C': // const_value_index, CONSTANT_Integer annotationVisitor.visit( elementName, (char) readInt(cpInfoOffsets[readUnsignedShort(currentOffset)])); currentOffset += 2; case 'I': // const_value_index, CONSTANT_Integer case 'J': // const_value_index, CONSTANT_Long annotationVisitor.visit( elementName, readConst(readUnsignedShort(currentOffset), charBuffer)); currentOffset += 2; break; case 'S': // const_value_index, CONSTANT_Integer annotationVisitor.visit( elementName, (short) readInt(cpInfoOffsets[readUnsignedShort(currentOffset)])); currentOffset += 2; annotationVisitor.visit( elementName, readInt(cpInfoOffsets[readUnsignedShort(currentOffset)]) == 0 break; case 's': // const_value_index, CONSTANT_Utf8 annotationVisitor.visit(elementName, readUTF8(currentOffset, charBuffer)); currentOffset += 2; break;
@Override public void begin(final String nm, final Attributes attrs) throws SAXException { AnnotationVisitor av = (AnnotationVisitor) peek(); if (av != null) { av.visit( attrs.getValue("name"), getValue(attrs.getValue("desc"), attrs.getValue("value"))); } } }
@Override public void visit(final String name, final Object value) { checkEnd(); checkName(name); if (!(value instanceof Byte || value instanceof Boolean || value instanceof Character || value instanceof Short || value instanceof Integer || value instanceof Long || value instanceof Float || value instanceof Double || value instanceof String || value instanceof Type || value instanceof byte[] || value instanceof boolean[] || value instanceof char[] || value instanceof short[] || value instanceof int[] || value instanceof long[] || value instanceof float[] || value instanceof double[])) { throw new IllegalArgumentException("Invalid annotation value"); } if (value instanceof Type) { int sort = ((Type) value).getSort(); if (sort == Type.METHOD) { throw new IllegalArgumentException("Invalid annotation value"); } } if (av != null) { av.visit(name, value); } }
av0.visit( "logical", core.isFullTraiting() );