Package org.jfree.xml.parser

Examples of org.jfree.xml.parser.XmlReadHandler


     * @throws XmlReaderException if there is a problem with the reader.
     * @throws SAXException if there is a parsing error.
     */
    protected XmlReadHandler getHandlerForChild(final String tagName, final Attributes atts)
        throws XmlReaderException, SAXException {
        final XmlReadHandler handler = getRootHandler().createHandler(Object.class, tagName, atts);
        this.handlers.add(handler);
        return handler;
    }
View Full Code Here


        if (!tagName.equals("entry")) {
            throw new SAXException("Expected 'entry' tag.");
        }

        final XmlReadHandler handler = new RenderingHintValueReadHandler();
        this.handlers.add(handler);
        return handler;
    }
View Full Code Here

    protected XmlReadHandler getHandlerForChild(final String tagName, final Attributes atts)
        throws SAXException {
        try {
            if (tagName.equals("objectRef")) {
                // store them all and copy the properties later when the object is created
                final XmlReadHandler handler = new ObjectRefHandler();
                this.objectRefHandlers.add(handler);
                return handler;
            }
            final XmlReadHandler handler = getRootHandler().createHandler
                (this.objectFactory.getTypeForTagName(tagName), tagName, atts);
            if (handler != null) {
                this.createdHandler.put(tagName, handler);
            }
            // will throw exception if handler is null...
View Full Code Here

                }
                if (this.objectFactory.isPropertyDefinition(cDef.getPropertyName())) {
                    final PropertyDefinition pd = this.objectFactory.getPropertyDefinitionByPropertyName(
                        cDef.getPropertyName()
                    );
                    final XmlReadHandler handler = (XmlReadHandler) this.createdHandler.get(
                        pd.getElementName()
                    );
                    if (handler != null) {
                        this.objectFactory.setProperty(pd.getPropertyName(), handler.getObject());
                    }
                }
                // hoping that the attribute is set ..
            }

            this.object = this.objectFactory.createObject();
            Object oldValue = null;
            if (this.objectFactory.getRegisterName() != null) {
                oldValue = rootHandler.getHelperObject(this.objectFactory.getRegisterName());
                rootHandler.setHelperObject(this.objectFactory.getRegisterName(), this.object);
            }

            final PropertyDefinition[] propertyDefs = this.objectFactory.getPropertyDefinitions();
            for (int i = 0; i < propertyDefs.length; i++) {
                final PropertyDefinition pdef = propertyDefs[i];
                final XmlReadHandler handler = (XmlReadHandler) this.createdHandler.get(
                    pdef.getElementName()
                );
                if (handler == null) {
                    continue;
                }
                this.objectFactory.setProperty(pdef.getPropertyName(), handler.getObject());
            }

            this.objectFactory.writeObjectProperties(this.object);

            if (this.objectFactory.getRegisterName() != null) {
View Full Code Here

     * @throws XmlReaderException if there is a problem with the reader.
     * @throws SAXException if there is a parsing error.
     */
    protected XmlReadHandler getHandlerForChild(final String tagName, final Attributes atts)
        throws XmlReaderException, SAXException {
        final XmlReadHandler handler = getRootHandler().createHandler(Object.class, tagName, atts);
        this.handlers.add(handler);
        return handler;
    }
View Full Code Here

        if (!tagName.equals("entry")) {
            throw new SAXException("Expected 'entry' tag.");
        }

        final XmlReadHandler handler = new RenderingHintValueReadHandler();
        this.handlers.add(handler);
        return handler;
    }
View Full Code Here

    protected XmlReadHandler getHandlerForChild(final String tagName, final Attributes atts)
        throws SAXException {
        try {
            if (tagName.equals("objectRef")) {
                // store them all and copy the properties later when the object is created
                final XmlReadHandler handler = new ObjectRefHandler();
                this.objectRefHandlers.add(handler);
                return handler;
            }
            final XmlReadHandler handler = this.rootHandler.createHandler
                (this.objectFactory.getTypeForTagName(tagName), tagName, atts);
            if (handler != null) {
                this.createdHandler.put(tagName, handler);
            }
            // will throw exception if handler is null...
View Full Code Here

                }
                if (this.objectFactory.isPropertyDefinition(cDef.getPropertyName())) {
                    final PropertyDefinition pd = this.objectFactory.getPropertyDefinitionByPropertyName(
                        cDef.getPropertyName()
                    );
                    final XmlReadHandler handler = (XmlReadHandler) this.createdHandler.get(
                        pd.getElementName()
                    );
                    if (handler != null) {
                        this.objectFactory.setProperty(pd.getPropertyName(), handler.getObject());
                    }
                }
                // hoping that the attribute is set ..
            }

            this.object = this.objectFactory.createObject();
            Object oldValue = null;
            if (this.objectFactory.getRegisterName() != null) {
                oldValue = rootHandler.getObject(this.objectFactory.getRegisterName());
                rootHandler.putObject(this.objectFactory.getRegisterName(), this.object);
            }

            final PropertyDefinition[] propertyDefs = this.objectFactory.getPropertyDefinitions();
            for (int i = 0; i < propertyDefs.length; i++) {
                final PropertyDefinition pdef = propertyDefs[i];
                final XmlReadHandler handler = (XmlReadHandler) this.createdHandler.get(
                    pdef.getElementName()
                );
                if (handler == null) {
                    continue;
                }
                this.objectFactory.setProperty(pdef.getPropertyName(), handler.getObject());
            }

            this.objectFactory.writeObjectProperties(this.object);

            if (this.objectFactory.getRegisterName() != null) {
View Full Code Here

TOP

Related Classes of org.jfree.xml.parser.XmlReadHandler

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.