Examples of NewAttribute


Examples of org.apache.harmony.pack200.NewAttribute

        CPUTF8 name = new CPUTF8("TestAttribute");
        CPUTF8 layout = new CPUTF8("B");
        MockNewAttributeBands newAttributeBands = new MockNewAttributeBands(1,
                null, null, new AttributeDefinition(35,
                        AttributeDefinitionBands.CONTEXT_CLASS, name, layout));
        newAttributeBands.addAttribute(new NewAttribute(null, "TestAttribute", "B", new byte[] {27}, null, 0, null));
        newAttributeBands.addAttribute(new NewAttribute(null, "TestAttribute", "B", new byte[] {56}, null, 0, null));
        newAttributeBands.addAttribute(new NewAttribute(null, "TestAttribute", "B", new byte[] {3}, null, 0, null));
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        newAttributeBands.pack(out);
        // BYTE1 is used for B layouts so we don't need to unpack to test the results
        byte[] bytes = out.toByteArray();
        assertEquals(3, bytes.length);
View Full Code Here

Examples of org.apache.harmony.pack200.NewAttribute

        CPUTF8 name = new CPUTF8("TestAttribute");
        CPUTF8 layout = new CPUTF8("NB[SH]");
        MockNewAttributeBands newAttributeBands = new MockNewAttributeBands(1,
                null, null, new AttributeDefinition(35,
                        AttributeDefinitionBands.CONTEXT_CLASS, name, layout));
        newAttributeBands.addAttribute(new NewAttribute(null, "TestAttribute", "B", new byte[] {1, 0, 100}, null, 0, null));
        short s = -50;
        byte b1 = (byte)(s>>>8);
        byte b2 = (byte)s;
        newAttributeBands.addAttribute(new NewAttribute(null, "TestAttribute", "B", new byte[] {3, 0, 5, 0, 25, b1, b2}, null, 0, null));
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        newAttributeBands.pack(out);
        byte[] bytes = out.toByteArray();
        assertEquals(1, bytes[0]);
        assertEquals(3, bytes[1]);
View Full Code Here

Examples of org.apache.harmony.pack200.bytecode.NewAttribute

     * @param index
     * @param elements
     * @return
     */
    private Attribute getOneAttribute(int index, List elements) {
        NewAttribute attribute = new NewAttribute(attributeLayout.getName());
        for (Iterator iter = elements.iterator(); iter.hasNext();) {
            AttributeLayoutElement element = (AttributeLayoutElement) iter.next();
            element.addToAttribute(index, attribute);
        }
        return attribute;
View Full Code Here

Examples of org.apache.harmony.unpack200.bytecode.NewAttribute

     * @param index
     * @param elements
     * @return
     */
    private Attribute getOneAttribute(int index, List elements) {
        NewAttribute attribute = new NewAttribute(segment.getCpBands()
                .cpUTF8Value(attributeLayout.getName()),
                attributeLayout.getIndex());
        for(int i = 0; i < elements.size(); i++) {
            AttributeLayoutElement element = (AttributeLayoutElement) elements.get(i);
            element.addToAttribute(index, attribute);
View Full Code Here

Examples of org.apache.harmony.unpack200.bytecode.NewAttribute

     * @param index
     * @param elements
     * @return
     */
    private Attribute getOneAttribute(int index, List elements) {
        NewAttribute attribute = new NewAttribute(segment.getCpBands()
                .cpUTF8Value(attributeLayout.getName()),
                attributeLayout.getIndex());
        for(int i = 0; i < elements.size(); i++) {
            AttributeLayoutElement element = (AttributeLayoutElement) elements.get(i);
            element.addToAttribute(index, attribute);
View Full Code Here

Examples of org.apache.harmony.unpack200.bytecode.NewAttribute

     * @param index
     * @param elements
     * @return
     */
    private Attribute getOneAttribute(int index, List elements) {
        NewAttribute attribute = new NewAttribute(segment.getCpBands()
                .cpUTF8Value(attributeLayout.getName()),
                attributeLayout.getIndex());
        for(int i = 0; i < elements.size(); i++) {
            AttributeLayoutElement element = (AttributeLayoutElement) elements.get(i);
            element.addToAttribute(index, attribute);
View Full Code Here

Examples of org.apache.harmony.unpack200.bytecode.NewAttribute

     * @param index
     * @param elements
     * @return
     */
    private Attribute getOneAttribute(int index, List elements) {
        NewAttribute attribute = new NewAttribute(segment.getCpBands()
                .cpUTF8Value(attributeLayout.getName()),
                attributeLayout.getIndex());
        for(int i = 0; i < elements.size(); i++) {
            AttributeLayoutElement element = (AttributeLayoutElement) elements.get(i);
            element.addToAttribute(index, attribute);
View Full Code Here

Examples of org.apache.harmony.unpack200.bytecode.NewAttribute

     * @param index
     * @param elements
     * @return
     */
    private Attribute getOneAttribute(int index, List elements) {
        NewAttribute attribute = new NewAttribute(segment.getCpBands()
                .cpUTF8Value(attributeLayout.getName()),
                attributeLayout.getIndex());
        for(int i = 0; i < elements.size(); i++) {
            AttributeLayoutElement element = (AttributeLayoutElement) elements.get(i);
            element.addToAttribute(index, attribute);
View Full Code Here

Examples of org.apache.harmony.unpack200.bytecode.NewAttribute

     * @param index
     * @param elements
     * @return
     */
    private Attribute getOneAttribute(int index, List elements) {
        NewAttribute attribute = new NewAttribute(segment.getCpBands()
                .cpUTF8Value(attributeLayout.getName(),
                        ClassConstantPool.DOMAIN_ATTRIBUTEASCIIZ));
        for (Iterator iter = elements.iterator(); iter.hasNext();) {
            AttributeLayoutElement element = (AttributeLayoutElement) iter
                    .next();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.