Package org.apache.harmony.unpack200.bytecode.AnnotationsAttribute

Examples of org.apache.harmony.unpack200.bytecode.AnnotationsAttribute.ElementValue


                                name_RU_Iterator));
                    }
                } else { // type.equals("AD")
                    for (int i = 0; i < T.length; i++) {
                        attributes.add(new AnnotationDefaultAttribute(
                                new ElementValue(T[i], getNextValue(T[i]))));
                    }
                }
            }
        }
        return attributes;
View Full Code Here


        CPUTF8[] elementNames = new CPUTF8[pairCount];
        ElementValue[] elementValues = new ElementValue[pairCount];
        for (int j = 0; j < elementNames.length; j++) {
            elementNames[j] = (CPUTF8) namesIterator.next();
            int t = ((Integer) T_iterator.next()).intValue();
            elementValues[j] = new ElementValue(t, getNextValue(t));
        }
        return new Annotation(pairCount, type, elementNames, elementValues);
    }
View Full Code Here

        case '[':
            int arraySize = ((Integer) casearray_Iterator.next()).intValue();
            ElementValue[] nestedArray = new ElementValue[arraySize];
            for (int i = 0; i < arraySize; i++) {
                int nextT = ((Integer) T_iterator.next()).intValue();
                nestedArray[i] = new ElementValue(nextT, getNextValue(nextT));
            }
            return nestedArray;
        case '@':
            CPUTF8 type = (CPUTF8) nesttype_RS_Iterator.next();
            int numPairs = ((Integer) nestpair_N_Iterator.next()).intValue();
View Full Code Here

        // that will
        // be written out. Keep SourceFileAttributes out since we just
        // did them above.
        ArrayList classAttributesWithoutSourceFileAttribute = new ArrayList(classAttributes.size());
        for (int index = 0; index < classAttributes.size(); index++) {
            Attribute attrib = (Attribute) classAttributes.get(index);
            if (!attrib.isSourceFileAttribute()) {
                classAttributesWithoutSourceFileAttribute.add(attrib);
            }
        }
        Attribute[] originalAttributes = classFile.attributes;
        classFile.attributes = new Attribute[originalAttributes.length
                + classAttributesWithoutSourceFileAttribute.size()];
        System.arraycopy(originalAttributes, 0, classFile.attributes, 0,
                originalAttributes.length);
        for (int index = 0; index < classAttributesWithoutSourceFileAttribute
                .size(); index++) {
            Attribute attrib = ((Attribute) classAttributesWithoutSourceFileAttribute
                    .get(index));
            cp.add(attrib);
            classFile.attributes[originalAttributes.length + index] = attrib;
        }
View Full Code Here

            String innerClassString = icStored.thisClassString();
            String outerClassString = icStored.outerClassString();
            String simpleClassName = icStored.simpleClassName();

            CPClass innerClass = null;
            CPUTF8 innerName = null;
            CPClass outerClass = null;

            innerClass = innerClassIndex != -1 ? cpBands
                    .cpClassValue(innerClassIndex) : cpBands
                    .cpClassValue(innerClassString);
            if (!icStored.isAnonymous()) {
View Full Code Here

        pool.resolve(new Segment());
        assertTrue(pool.indexOf(u1) > 0);
    }

    public void testAllClasses() {
        pool.add(new CPClass(new CPUTF8("RandomClass", 1), 10));
        pool.add(new CPClass(new CPUTF8("RandomClass2", 2), 20));
        assertEquals(2, pool.allClasses().size());
    }
View Full Code Here

        CPLong cp3 = new CPLong(new Long(5), 5);
        checkEquality(cp1, cp2, "3", cp3); //$NON-NLS-1$
    }

    public void testCPDouble() {
        CPDouble cp1 = new CPDouble(new Double(3), 3);
        CPDouble cp2 = new CPDouble(new Double(3), 3);
        CPDouble cp3 = new CPDouble(new Double(5), 5);
        checkEquality(cp1, cp2, "3", cp3); //$NON-NLS-1$
    }
View Full Code Here

        public CPLong cpLongValue(int index) {
            return new CPLong(new Long(21L), index);
        }

        public CPDouble cpDoubleValue(int index) {
            return new CPDouble(new Double(2.5D), index);
        }
View Full Code Here

            int descriptorIndex = classBands.getFieldDescrInts()[classNum][i];
            int nameIndex = cpBands.getCpDescriptorNameInts()[descriptorIndex];
            int typeIndex = cpBands.getCpDescriptorTypeInts()[descriptorIndex];
            CPUTF8 name = cpBands.cpUTF8Value(nameIndex);
            CPUTF8 descriptor = cpBands.cpSignatureValue(typeIndex);
            cfFields[i] = cp.add(new CPField(name, descriptor, classBands
                    .getFieldFlags()[classNum][i], classBands
                    .getFieldAttributes()[classNum][i]));
        }
        // add methods
        ClassFileEntry cfMethods[] = new ClassFileEntry[classBands
View Full Code Here

        public CPDouble cpDoubleValue(int index) {
            return new CPDouble(new Double(2.5D), index);
        }

        public CPFieldRef cpFieldValue(int index) {
            return new CPFieldRef(cpClass, descriptor, index);
        }
View Full Code Here

TOP

Related Classes of org.apache.harmony.unpack200.bytecode.AnnotationsAttribute.ElementValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.