/** * A method which is common to both {@code Marshaller} and {@code Unmarshaller}. * It saves the initial state if it was not already done, but subclasses will * need to complete the work. */ @SuppressWarnings("rawtypes") public <A extends XmlAdapter> void setAdapter(final Class<A> type, final A adapter) { if (!isPropertySaved(type)) { saveProperty(type, getAdapter(type)); } }
/** * A method which is common to both {@code Marshaller} and {@code Unmarshaller}. * It saves the initial state if it was not already done, but subclasses will * need to complete the work. */ public void setEventHandler(final ValidationEventHandler handler) throws JAXBException { if (!initialProperties.containsKey(ValidationEventHandler.class)) { saveProperty(ValidationEventHandler.class, getEventHandler()); } }
/** * A method which is common to both {@code Marshaller} and {@code Unmarshaller}. * It saves the initial state if it was not already done, but subclasses will * need to complete the work. */ public void setSchema(final Schema schema) { if (!isPropertySaved(Schema.class)) { saveProperty(Schema.class, getSchema()); } }
/** * Completes the creation of a {@link PooledMarshaller} or {@link PooledUnmarshaller}. * This method is not invoked in the {@link #Pooled(Pooled)} constructor in order to * give to subclasses a chance to complete their construction first. * * @param template the {@link PooledTemplate} from which to get the initial values. * @throws JAXBException if an error occurred while setting a property. */ final void initialize(final Pooled template) throws JAXBException { reset(template); // Set the SIS properties first. JAXB properties are set below. for (final Map.Entry<Object,Object> entry : template.initialProperties.entrySet()) { setStandardProperty((String) entry.getKey(), entry.getValue()); } }
name = Implementation.toInternal(name); if (!initialProperties.containsKey(name) && initialProperties.put(name, getStandardProperty(name)) != null) { setStandardProperty(name, value);
/** * Delegates to {@code setAdapter(adapter.getClass(), adapter)} as specified * in {@code [Un]Marshaller} javadoc. */ @SuppressWarnings({"unchecked","rawtypes"}) public final void setAdapter(final XmlAdapter adapter) { setAdapter((Class) adapter.getClass(), adapter); }
/** * Delegates to the wrapped unmarshaller. The initial state will be saved * if it was not already done, for future restoration by {@link #reset(Pooled)}. */ @Override public void setSchema(final Schema schema) { super.setSchema(schema); unmarshaller.setSchema(schema); }
/** * Delegates to the wrapped marshaller. The initial state will be saved * if it was not already done, for future restoration by {@link #reset(Pooled)}. */ @Override public void setEventHandler(final ValidationEventHandler handler) throws JAXBException { super.setEventHandler(handler); marshaller.setEventHandler(handler); }
/** * Releases resources and resets the (un)marshaller to its initial state. * This method is invoked by {@link MarshallerPool} just before to push a * (un)marshaller in the pool after its usage. * * @param template the {@link PooledTemplate} from which to get the initial values. * @throws JAXBException if an error occurred while restoring a property. */ public final void reset(final Pooled template) throws JAXBException { for (final Map.Entry<Object,Object> entry : initialProperties.entrySet()) { reset(entry.getKey(), entry.getValue()); } initialProperties.clear(); bitMasks = template.bitMasks; locale = template.locale; timezone = template.timezone; schemas = template.schemas; versionGML = template.versionGML; versionMetadata = template.versionMetadata; resolver = template.resolver; converter = template.converter; rootAdapters = template.rootAdapters; warningListener = template.warningListener; resetTime = System.nanoTime(); if (this instanceof Marshaller) { bitMasks |= Context.MARSHALLING; } }
name = Implementation.toInternal(name); return getStandardProperty(name);
/** * Completes the creation of a {@link PooledMarshaller} or {@link PooledUnmarshaller}. * This method is not invoked in the {@link #Pooled(Pooled)} constructor in order to * give to subclasses a chance to complete their construction first. * * @param template the {@link PooledTemplate} from which to get the initial values. * @throws JAXBException if an error occurred while setting a property. */ final void initialize(final Pooled template) throws JAXBException { reset(template); // Set the SIS properties first. JAXB properties are set below. for (final Map.Entry<Object,Object> entry : template.initialProperties.entrySet()) { setStandardProperty((String) entry.getKey(), entry.getValue()); } }
name = Implementation.toInternal(name); if (!initialProperties.containsKey(name) && initialProperties.put(name, getStandardProperty(name)) != null) { setStandardProperty(name, value);
/** * Delegates to {@code setAdapter(adapter.getClass(), adapter)} as specified * in {@code [Un]Marshaller} javadoc. */ @SuppressWarnings({"unchecked","rawtypes"}) public final void setAdapter(final XmlAdapter adapter) { setAdapter((Class) adapter.getClass(), adapter); }
/** * Delegates to the wrapped unmarshaller. The initial state will be saved * if it was not already done, for future restoration by {@link #reset(Pooled)}. */ @Override public void setSchema(final Schema schema) { super.setSchema(schema); unmarshaller.setSchema(schema); }
/** * Delegates to the wrapped unmarshaller. The initial state will be saved * if it was not already done, for future restoration by {@link #reset(Pooled)}. */ @Override public void setEventHandler(final ValidationEventHandler handler) throws JAXBException { super.setEventHandler(handler); unmarshaller.setEventHandler(handler); }
/** * Releases resources and resets the (un)marshaller to its initial state. * This method is invoked by {@link MarshallerPool} just before to push a * (un)marshaller in the pool after its usage. * * @param template the {@link PooledTemplate} from which to get the initial values. * @throws JAXBException if an error occurred while restoring a property. */ public final void reset(final Pooled template) throws JAXBException { for (final Map.Entry<Object,Object> entry : initialProperties.entrySet()) { reset(entry.getKey(), entry.getValue()); } initialProperties.clear(); bitMasks = template.bitMasks; locale = template.locale; timezone = template.timezone; schemas = template.schemas; xmlnsReplaceCode = template.xmlnsReplaceCode; versionGML = template.versionGML; resolver = template.resolver; converter = template.converter; rootAdapters = template.rootAdapters; warningListener = template.warningListener; resetTime = System.nanoTime(); if (this instanceof Marshaller) { bitMasks |= Context.MARSHALLING; } }
name = Implementation.toInternal(name); return getStandardProperty(name);
/** * A method which is common to both {@code Marshaller} and {@code Unmarshaller}. * It saves the initial state if it was not already done, but subclasses will * need to complete the work. */ public void setSchema(final Schema schema) { if (!isPropertySaved(Schema.class)) { saveProperty(Schema.class, getSchema()); } }
/** * A method which is common to both {@code Marshaller} and {@code Unmarshaller}. * It saves the initial state if it was not already done, but subclasses will * need to complete the work. */ @SuppressWarnings("rawtypes") public <A extends XmlAdapter> void setAdapter(final Class<A> type, final A adapter) { if (!isPropertySaved(type)) { saveProperty(type, getAdapter(type)); } }
/** * A method which is common to both {@code Marshaller} and {@code Unmarshaller}. * It saves the initial state if it was not already done, but subclasses will * need to complete the work. */ public void setEventHandler(final ValidationEventHandler handler) throws JAXBException { if (!initialProperties.containsKey(ValidationEventHandler.class)) { saveProperty(ValidationEventHandler.class, getEventHandler()); } }