public ObjectMapper create(boolean defaultUseWrapper) { JacksonXmlModule module = new JacksonXmlModule(); module.setDefaultUseWrapper(defaultUseWrapper); return new XmlMapper(new XmlFactory(StaxUtils.createDefensiveInputFactory()), module); } }
public ObjectMapper create(boolean defaultUseWrapper) { JacksonXmlModule module = new JacksonXmlModule(); module.setDefaultUseWrapper(defaultUseWrapper); return new XmlMapper(new XmlFactory(StaxUtils.createDefensiveInputFactory()), module); } }
/** * Note: compared to base implementation by {@link TokenStreamFactory}, * here the copy will actually share underlying XML input and * output factories, as there is no way to make copies of those. */ @Override public XmlFactory copy() { return new XmlFactory(this); }
@Override public XmlFactory build() { // 28-Dec-2017, tatu: No special settings beyond base class ones, so: return new XmlFactory(this); } }
/** * @since 2.4 */ public XmlMapper(XMLInputFactory inputF, XMLOutputFactory outF) { this(new XmlFactory(inputF, outF)); }
/** * @since 2.4 */ public XmlMapper(XMLInputFactory inputF) { this(new XmlFactory(inputF)); }
public XmlMapper() { this(new XmlFactory()); }
public XmlMapper() { this(new XmlFactory()); }
public XmlFactory withNameForTextElement(String name) { if (name == null) { name = ""; } if (name.equals(_cfgNameForTextElement)) { return this; } return new XmlFactory(this, name); }
public static XmlMapper.Builder xmlBuilder() { return new XmlMapper.Builder(new XmlFactory()); }
public static XmlMapper.Builder builder() { return new XmlMapper.Builder(new XmlFactory()); }
protected static XmlFactory createXmlFactory(XMLInputFactory inputFactory, XMLOutputFactory outputFactory) { XmlFactory xmlFactory = new XmlFactory(inputFactory, outputFactory); try { xmlFactory.configure(ToXmlGenerator.Feature.WRITE_XML_1_1, true); } catch (Exception e) { logger.log(Level.SEVERE, e.getMessage(), e); } return xmlFactory; }
/** * Note: compared to base implementation by {@link JsonFactory}, * here the copy will actually share underlying XML input and * output factories, as there is no way to make copies of those. * * @since 2.1 */ @Override public XmlFactory copy() { _checkInvalidCopy(XmlFactory.class); return new XmlFactory(this, null); }
private static class XmlObjectMapperInitializer { public ObjectMapper create() { return new XmlMapper(StaxUtils.createDefensiveInputFactory()); } public ObjectMapper create(boolean defaultUseWrapper) { JacksonXmlModule module = new JacksonXmlModule(); module.setDefaultUseWrapper(defaultUseWrapper); return new XmlMapper(new XmlFactory(StaxUtils.createDefensiveInputFactory()), module); } }
public ObjectMapper create(boolean defaultUseWrapper) { JacksonXmlModule module = new JacksonXmlModule(); module.setDefaultUseWrapper(defaultUseWrapper); return new XmlMapper(new XmlFactory(StaxUtils.createDefensiveInputFactory()), module); } }
public ResWrap<ServiceDocument> toServiceDocument(InputStream input) throws ODataDeserializerException { try { JsonParser parser = new XmlFactory().createParser(input); return doDeserialize(parser); } catch (final IOException e) { throw new ODataDeserializerException(e); } } }
public ResWrap<ServiceDocument> toServiceDocument(InputStream input) throws ODataDeserializerException { try { JsonParser parser = new XmlFactory().createParser(input); return doDeserialize(parser); } catch (final IOException e) { throw new ODataDeserializerException(e); } } }
public XmlParser() { xmlFactory = new XmlFactory(); xmlMapper = new XmlMapper(xmlFactory, new JacksonXmlModule()); }
public XmlMapper(XmlFactory xmlFactory, JacksonXmlModule module) { /* Need to override serializer provider (due to root name handling); * deserializer provider fine as is */ super(xmlFactory, new XmlSerializerProvider(new XmlRootNameLookup()), null); _xmlModule = module; // but all the rest is done via Module interface! if (module != null) { registerModule(module); } // 19-May-2015, tatu: Must ensure we use XML-specific indenter _serializationConfig = _serializationConfig.withDefaultPrettyPrinter(DEFAULT_XML_PRETTY_PRINTER); }
protected XmlMapper getXmlMapper() { final XmlMapper xmlMapper = new XmlMapper( new XmlFactory(new InputFactoryImpl(), new OutputFactoryImpl()), new JacksonXmlModule()); xmlMapper.setInjectableValues(new InjectableValues.Std().addValue(Boolean.class, Boolean.FALSE)); xmlMapper.addHandler(new DeserializationProblemHandler() { @Override public boolean handleUnknownProperty(final DeserializationContext ctxt, final JsonParser jp, final com.fasterxml.jackson.databind.JsonDeserializer<?> deserializer, final Object beanOrClass, final String propertyName) throws IOException, JsonProcessingException { // skip any unknown property ctxt.getParser().skipChildren(); return true; } }); return xmlMapper; }