Package org.xml.sax.helpers

Examples of org.xml.sax.helpers.AttributesImpl


        final String[] exceptions)
    {
        StringBuffer sb = new StringBuffer();
        appendAccess(access, sb);

        AttributesImpl att = new AttributesImpl();
        att.addAttribute("", "access", "access", "", sb.toString());
        att.addAttribute("", "name", "name", "", name);
        att.addAttribute("", "desc", "desc", "", desc);
        if (signature != null) {
            att.addAttribute("", "signature", "signature", "", signature);
        }
        addStart("method", att);

        addStart("exceptions", new AttributesImpl());
        if (exceptions != null && exceptions.length > 0) {
            for (int i = 0; i < exceptions.length; i++) {
                AttributesImpl att2 = new AttributesImpl();
                att2.addAttribute("", "name", "name", "", exceptions[i]);
                addElement("exception", att2);
            }
        }
        addEnd("exceptions");
View Full Code Here


        final int access)
    {
        StringBuffer sb = new StringBuffer();
        appendAccess(access | ACCESS_INNER, sb);

        AttributesImpl att = new AttributesImpl();
        att.addAttribute("", "access", "access", "", sb.toString());
        if (name != null) {
            att.addAttribute("", "name", "name", "", name);
        }
        if (outerName != null) {
            att.addAttribute("", "outerName", "outerName", "", outerName);
        }
        if (innerName != null) {
            att.addAttribute("", "innerName", "innerName", "", innerName);
        }
        addElement("innerclass", att);
    }
View Full Code Here

        os = new OutputStreamWriter(new FileOutputStream(myFile), "UTF-8");
    }

    public void saveFile() {
        try {
            AttributesImpl attrs = new AttributesImpl();
            StreamResult result = new StreamResult(os);
            SAXTransformerFactory factory = (SAXTransformerFactory) SAXTransformerFactory
                    .newInstance();
            TransformerHandler handler = factory.newTransformerHandler();
            Transformer serializer = handler.getTransformer();
View Full Code Here

        write(s + "</previous-tasks>");
    }

    public void saveFilesFromLoaded(ArrayList tasks) {
        try {
            AttributesImpl attrs = new AttributesImpl();
            StreamResult result = new StreamResult(os);
            SAXTransformerFactory factory = (SAXTransformerFactory) SAXTransformerFactory
                    .newInstance();
            TransformerHandler handler = factory.newTransformerHandler();
            Transformer serializer = handler.getTransformer();
View Full Code Here

            // handler.startDTD("ganttproject.sourceforge.net",
            // "-//GanttProject.org//DTD GanttProject-1.x//EN",
            // "http://ganttproject.sourceforge.net/dtd/ganttproject.dtd");
            // handler.endDTD();
            //
            AttributesImpl attrs = new AttributesImpl();
            handler.startElement("", "ganttproject-options",
                    "ganttproject-options", attrs);
            //
            attrs.addAttribute("", "selection", "selection", "CDATA", language
                    .getText("shortLanguage"));
            handler.startElement("", "language", "language", attrs);
            handler.endElement("", "language", "language");
            attrs.clear();
            // write the task Color
            /*
             * Color color = getUIConfiguration().getTaskColor();
             * attrs.addAttribute("", "red", "red", "CDATA", ""+color.getRed());
             * attrs.addAttribute("", "green", "green", "CDATA",
             * ""+color.getGreen()); attrs.addAttribute("", "blue", "blue",
             * "CDATA", ""+color.getBlue()); handler.startElement("",
             * "task-color", "task-color", attrs); handler.endElement("",
             * "task-color", "task-color"); attrs.clear();
             */

            Color resourceColor = myUIConfig.getResourceColor();
            if (resourceColor != null)
                attrs.addAttribute("", "resources", "resources", "CDATA", ""
                        + ColorConvertion.getColor(resourceColor));
            Color resourceOverloadColor = myUIConfig.getResourceOverloadColor();
            if (resourceOverloadColor != null)
                attrs.addAttribute("", "resourcesOverload",
                        "resourcesOverload", "CDATA", ""
                                + ColorConvertion
                                        .getColor(resourceOverloadColor));
            Color resourceUnderloadColor = myUIConfig
                    .getResourceUnderloadColor();
            if (resourceUnderloadColor != null)
                attrs.addAttribute("", "resourcesUnderload",
                        "resourcesUnderload", "CDATA", ""
                                + ColorConvertion
                                        .getColor(resourceUnderloadColor));
            Color weekEndColor = myUIConfig.getWeekEndColor();
            if (weekEndColor != null)
                attrs.addAttribute("", "weekEnd", "weekEnd", "CDATA", ""
                        + ColorConvertion.getColor(weekEndColor));
            Color daysOffColor = myUIConfig.getDayOffColor();
            if (daysOffColor != null)
                attrs.addAttribute("", "daysOff", "daysOff", "CDATA", ""
                        + ColorConvertion.getColor(daysOffColor));
            handler.startElement("", "colors", "colors", attrs);
            handler.endElement("", "colors", "colors");
            attrs.clear();

            // Geometry of the window
            addAttribute("x", "" + x, attrs);
            addAttribute("y", "" + y, attrs);
            addAttribute("width", "" + width, attrs);
View Full Code Here

    private void saveRoleSets(TransformerHandler handler)
            throws TransformerConfigurationException,
            TransformerFactoryConfigurationError, SAXException {
        RoleSet[] roleSets = getRoleManager().getRoleSets();
        for (int i = 0; i < roleSets.length; i++) {
            AttributesImpl attrs = new AttributesImpl();
            attrs.addAttribute("", "roleset-name", "roleset-name", "CDATA",
                    roleSets[i].getName());
            handler.startElement("", "roles", "roles", attrs);
            saveRoles(roleSets[i], handler);
            handler.endElement("", "roles", "roles");
        }
View Full Code Here

    }

    private void saveRoles(RoleSet roleSet, TransformerHandler handler)
            throws SAXException {
        Role[] roles = roleSet.getRoles();
        AttributesImpl attrs = new AttributesImpl();
        for (int i = 0; i < roles.length; i++) {
            Role next = roles[i];
            addAttribute("id", "" + next.getID(), attrs);
            addAttribute("name", next.getName(), attrs);
            emptyElement("role", attrs, handler);
View Full Code Here

    }

    private void saveIconPositions(TransformerHandler handler)
            throws TransformerConfigurationException,
            TransformerFactoryConfigurationError, SAXException {
        AttributesImpl attrs = new AttributesImpl();
        addAttribute("icons-list", iconListAsString, attrs);
        addAttribute("deletedIcons-list", deletedIconListAsString, attrs);
        emptyElement("positions", attrs, handler);
    }
View Full Code Here

        super(h);
        labelNames = new HashMap<Label, String>();

        if ((access & (Opcodes.ACC_ABSTRACT | Opcodes.ACC_INTERFACE | Opcodes.ACC_NATIVE)) == 0)
        {
            addStart("code", new AttributesImpl());
        }
    }
View Full Code Here

        final int nLocal,
        final Object[] local,
        final int nStack,
        final Object[] stack)
    {
        AttributesImpl attrs = new AttributesImpl();
        switch (type) {
            case Opcodes.F_NEW:
            case Opcodes.F_FULL:
                if (type == Opcodes.F_NEW) {
                    attrs.addAttribute("", "type", "type", "", "NEW");
                } else {
                    attrs.addAttribute("", "type", "type", "", "FULL");
                }
                addStart("frame", attrs);
                appendFrameTypes(true, nLocal, local);
                appendFrameTypes(false, nStack, stack);
                break;
            case Opcodes.F_APPEND:
                attrs.addAttribute("", "type", "type", "", "APPEND");
                addStart("frame", attrs);
                appendFrameTypes(true, nLocal, local);
                break;
            case Opcodes.F_CHOP:
                attrs.addAttribute("", "type", "type", "", "CHOP");
                attrs.addAttribute("",
                        "count",
                        "count",
                        "",
                        Integer.toString(nLocal));
                addStart("frame", attrs);
                break;
            case Opcodes.F_SAME:
                attrs.addAttribute("", "type", "type", "", "SAME");
                addStart("frame", attrs);
                break;
            case Opcodes.F_SAME1:
                attrs.addAttribute("", "type", "type", "", "SAME1");
                addStart("frame", attrs);
                appendFrameTypes(false, 1, stack);
                break;
        }
        addEnd("frame");
View Full Code Here

TOP

Related Classes of org.xml.sax.helpers.AttributesImpl

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.