Unmarshaller Setvalidating True 18913

Меню

Search the Web:

Unmarshaller Setvalidating True 18913 на сайте oaeservice.ru



Apparently in version 2 of JAXB - the validator class has been deprecated - does this mean the marshaller is automatically validating your XML?

validating - true if the Unmarshaller should validate during unmarshal, false otherwise. Throws: JAXBException - if an error occurred while enabling or disabling validation at unmarshal time. This method replaces the deprecated setValidating(boolean) API. Initially this property is set to null.

The Unmarshaller class governs the process of deserializing XML data into newly created Java content trees, optionally validating the XML data as it is unmarshalled. spf.setValidating(true); SAXParser saxParser = spf.newSAXParser() This method replaces the deprecated setValidating(boolean) API.

Hi Andrew, Unmarshaller.setValidating is indeed deprecated and you need to set the Schema object to validate against. @Override public Unmarshaller createUnmarshaller() throws JAXBException { Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); unmarshaller.setValidating(true)...

unmarshaller.setSchema(schema); RAW Paste Data.

Картинки по запросу "unmarshaller setvalidating true 18913"

Где вы это делали: Unmarshaller.setValidating(true); Теперь вам нужно сделать: SchemaFactory sf = SchemaFactory.newInstance( javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = sf.newSchema(new File("myschema.xsd")); unmarshaller.setSchema(schema)...

setValidating(boolean validating) Specifies whether or not the default validation mechanism of the Unmarshaller should validate during unmarshal operations. Returns: true if the Unmarshaller is configured to validate during unmarshal operations, false otherwise. Throws

validating - true if the Unmarshaller should validate during unmarshal, false otherwise. Throws: JAXBException - if an error occurred while enabling or disabling validation at unmarshal time. This method replaces the deprecated setValidating(boolean) API. Initially this property is set to null.
Скриншот из видео клипа : Unmarshaller (Java EE 5) - Java EE API Documentation