/** * Parses a descriptor from InputStream without a validator. * @param is input to check * @return parsed PluginDescriptor * @throws PluginContainerException if validation fails */ public static PluginDescriptor parsePluginDescriptor(InputStream is) throws PluginContainerException { return parsePluginDescriptor(is, new ValidationEventCollector()); }
import java.io.StringReader; import javax.xml.bind.*; import javax.xml.bind.util.ValidationEventCollector; public class Demo { private static String XML = "<foo><bar>Hello World</bar></foo>"; public static void main(String[] args) throws Exception { JAXBContext jc = JAXBContext.newInstance(Foo.class); Unmarshaller unmarshaller = jc.createUnmarshaller(); unmarshaller.unmarshal(new StringReader(XML)); ValidationEventCollector vec = new ValidationEventCollector(); unmarshaller.setEventHandler(vec); unmarshaller.unmarshal(new StringReader(XML)); System.out.println(vec.getEvents().length); } }
ValidationEventCollector validationCollector = new JAXB2ValidationEventCollector(); unmarshaller.setEventHandler(validationCollector);
javax.xml.bind.util.ValidationEventCollector validationEventCollector = new javax.xml.bind.util.ValidationEventCollector(); um.setEventHandler(validationEventCollector);
m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE ); ValidationEventCollector handler = new ValidationEventCollector(); m.setEventHandler(handler ); StringWriter sw = new StringWriter();
ValidationEventCollector validationEventCollector = new ValidationEventCollector(); testPluginJarIsReadable(pluginJarFileUrl);
InputStream inputStream = ParseXML.class.getResourceAsStream(fullResourceName); ValidationEventCollector vec = new ValidationEventCollector(); URL xsdURL = ParseXML.class.getResource(schemaResource); try {
Schema schema = sf.newSchema(new StreamSource(new StringReader(xsd))); ValidationEventCollector eventHandler = new ValidationEventCollector(); unmarshaller.setEventHandler(eventHandler); unmarshaller.setSchema(schema);
ValidationEventCollector validationCollector = new ValidationEventCollector(); u.setEventHandler(validationCollector);
ValidationEventCollector handler = new ValidationEventCollector(); m.setEventHandler(handler); for (Capability capability : caps) {
m.setSchema(schema); ValidationEventCollector handler = new ValidationEventCollector(); m.setEventHandler(handler );
JAXBContext context = get(); ValidationEventCollector valEventHndlr = new ValidationEventCollector(); Marshaller marshaller = context.createMarshaller(); marshaller.setSchema(null);
JAXBContext context = get(); ValidationEventCollector valEventHndlr = new ValidationEventCollector(); Marshaller marshaller = context.createMarshaller(); marshaller.setSchema(null);
JAXBContext context = get(); ValidationEventCollector valEventHndlr = new ValidationEventCollector(); Unmarshaller unmarshaller = context.createUnmarshaller(); unmarshaller.setSchema(null);
JAXBContext context = get(); ValidationEventCollector valEventHndlr = new ValidationEventCollector(); Unmarshaller unmarshaller = context.createUnmarshaller(); unmarshaller.setSchema(null);
JAXBContext context = get(); ValidationEventCollector valEventHndlr = new ValidationEventCollector(); Marshaller marshaller = context.createMarshaller(); marshaller.setSchema(null);
JAXBContext context = get(); ValidationEventCollector valEventHndlr = new ValidationEventCollector(); Unmarshaller unmarshaller = context.createUnmarshaller(); unmarshaller.setSchema(null);
JAXBContext context = get(); ValidationEventCollector valEventHndlr = new ValidationEventCollector(); Marshaller marshaller = context.createMarshaller(); marshaller.setSchema(null);
public Object transform(Node source, TransformationContext context) { ValidationEventCollector validationEventCollector = new ValidationEventCollector(); Object response = null; if (source == null)
public Object transform(Node source, TransformationContext context) { ValidationEventCollector validationEventCollector = new ValidationEventCollector(); Object response = null; if (source == null)