protected Schema getSchema() { return getSchema(null); }
protected Schema getSchema() { return getSchema(null); }
protected void validateObjectIfNeeded(Marshaller marshaller, Class<?> cls, Object obj) throws JAXBException { if (validateOutputIfPossible) { Schema theSchema = getSchema(cls); if (theSchema != null) { marshaller.setEventHandler(eventHandler); marshaller.setSchema(theSchema); if (validateBeforeWrite) { marshaller.marshal(obj, new DefaultHandler()); marshaller.setSchema(null); } } } }
protected void validateObjectIfNeeded(Marshaller marshaller, Class<?> cls, Object obj) throws JAXBException { if (validateOutput) { Schema theSchema = getSchema(cls); if (theSchema != null) { marshaller.setEventHandler(eventHandler); marshaller.setSchema(theSchema); if (validateBeforeWrite) { marshaller.marshal(obj, new DefaultHandler()); marshaller.setSchema(null); } } } }
protected Unmarshaller createUnmarshaller(Class<?> cls, Type genericType, boolean isCollection) throws JAXBException { JAXBContext context = isCollection ? getCollectionContext(cls) : getJAXBContext(cls, genericType); Unmarshaller unmarshaller = context.createUnmarshaller(); Schema theSchema = getSchema(cls); if (theSchema != null) { unmarshaller.setSchema(theSchema); } if (eventHandler != null) { unmarshaller.setEventHandler(eventHandler); } if (unmarshallerListener != null) { unmarshaller.setListener(unmarshallerListener); } if (uProperties != null) { for (Map.Entry<String, Object> entry : uProperties.entrySet()) { unmarshaller.setProperty(entry.getKey(), entry.getValue()); } } return unmarshaller; }
protected Unmarshaller createUnmarshaller(Class<?> cls, Type genericType, boolean isCollection) throws JAXBException { JAXBContext context = isCollection ? getCollectionContext(cls) : getJAXBContext(cls, genericType); Unmarshaller unmarshaller = context.createUnmarshaller(); if (validateInputIfPossible) { Schema theSchema = getSchema(cls); if (theSchema != null) { unmarshaller.setSchema(theSchema); } } if (eventHandler != null) { unmarshaller.setEventHandler(eventHandler); } if (unmarshallerListener != null) { unmarshaller.setListener(unmarshallerListener); } if (uProperties != null) { for (Map.Entry<String, Object> entry : uProperties.entrySet()) { unmarshaller.setProperty(entry.getKey(), entry.getValue()); } } return unmarshaller; }