Package javax.xml.bind.helpers

Examples of javax.xml.bind.helpers.DefaultValidationEventHandler


    public JAXBBinder(XMLContext xmlContext) {
        this.xmlContext = xmlContext;
        this.xmlBinder = this.xmlContext.createBinder();
        this.xmlBinder.getDocumentPreservationPolicy().setNodeOrderingPolicy(new RelativePositionOrderingPolicy());
        this.xmlBinder.setErrorHandler(new JAXBErrorHandler(new DefaultValidationEventHandler()));
    }
View Full Code Here


        return this.xmlBinder.getSchema();
    }

    public void setEventHandler(ValidationEventHandler handler) {
        if (null == handler) {
            xmlBinder.setErrorHandler(new JAXBErrorHandler(new DefaultValidationEventHandler()));
        } else {
            xmlBinder.setErrorHandler(new JAXBErrorHandler(handler));
        }
    }
View Full Code Here

     *
     * @param newXMLMarshaller
     */
    public JAXBValidator(XMLValidator newValidator) {
        super();
        validationEventHandler = new DefaultValidationEventHandler();
        xmlValidator = newValidator;
    }
View Full Code Here

        }
    }

    public void setEventHandler(ValidationEventHandler newValidationEventHandler) throws JAXBException {
        if (null == newValidationEventHandler) {
            validationEventHandler = new DefaultValidationEventHandler();
        } else {
            validationEventHandler = newValidationEventHandler;
        }
        xmlValidator.setErrorHandler(new JAXBErrorHandler(validationEventHandler));
    }
View Full Code Here

                    // this method will be called only once.
                    throw new AssertionError();

                if(options.debugMode)
                    try {
                        u.setEventHandler(new DefaultValidationEventHandler());
                    } catch (JAXBException e) {
                        throw new AssertionError(e);    // ridiculous!
                    }

                handler = u.getUnmarshallerHandler();
View Full Code Here

    Unmarshaller unmarshaller = jc.createUnmarshaller();

    unmarshaller.setSchema(_schema);

    // Output parsing info to System.out
    unmarshaller.setEventHandler(new DefaultValidationEventHandler());

    // The resolver allows us to differentiate between trades and positions
    // that have the same id. With this a trade and position can both have
    // id = 1 in the xml file, yet be resolved correctly based on context.
    // TODO can this be done without using a sun.internal class?
View Full Code Here

                    // this method will be called only once.
                    throw new AssertionError();

                if(options.debugMode)
                    try {
                        u.setEventHandler(new DefaultValidationEventHandler());
                    } catch (JAXBException e) {
                        throw new AssertionError(e);    // ridiculous!
                    }

                handler = u.getUnmarshallerHandler();
View Full Code Here

        return eventHandler;
    }
   
    public void setEventHandler( ValidationEventHandler handler ) {
        if( handler == null ) {
            eventHandler = new DefaultValidationEventHandler();
        } else {
            eventHandler = handler;
        }
    }
View Full Code Here

TOP

Related Classes of javax.xml.bind.helpers.DefaultValidationEventHandler

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.