/** * Prints the responsible field of the given bean to the writer. * * <p> * Use {@link XMLSerializer#getInstance()} to access to the namespace bindings * * @return * if the accessor didn't yield a value, return null. */ public abstract @Nullable CharSequence print(@NotNull BeanT o) throws AccessorException, SAXException;
/** * Creates a new {@link BridgeContext} instance. * * @return * always a valid non-null instance. * * @since 2.0 EA1 */ public abstract @NotNull BridgeContext createBridgeContext();
/** * Returns the optimized version of the same accessor. * * @param context The {@link JAXBContextImpl} that owns the whole thing. * (See {@link RuntimeModelBuilder#context}.) * @return At least the implementation can return {@code this}. */ public Accessor<BeanT, ValueT> optimize(@Nullable JAXBContextImpl context) { return this; }
/** * @since 2.0.3 */ public final @NotNull T unmarshal(@NotNull XMLStreamReader in, @Nullable AttachmentUnmarshaller au) throws JAXBException { Unmarshaller u = context.unmarshallerPool.take(); u.setAttachmentUnmarshaller(au); return exit(unmarshal(u,in),u); } public final @NotNull T unmarshal(@NotNull BridgeContext context, @NotNull XMLStreamReader in) throws JAXBException {
private void addSubstitutionMember(ElementInfoImpl<T,C,F,M> child) { if(substitutionMembers==null) substitutionMembers = new FinalArrayList<ElementInfoImpl<T,C,F,M>>(); substitutionMembers.add(child); }
/** * @since 2.0.3 */ public final @NotNull T unmarshal(@NotNull Source in, @Nullable AttachmentUnmarshaller au) throws JAXBException { Unmarshaller u = context.unmarshallerPool.take(); u.setAttachmentUnmarshaller(au); return exit(unmarshal(u,in),u); } public final @NotNull T unmarshal(@NotNull BridgeContext context, @NotNull Source in) throws JAXBException {
/** * If the given object is bound to an element in XML by JAXB, * returns the element name. * * @return null * if the object is not bound to an element. * @throws JAXBException * if the object is not known to this context. * * @since 2.0 EA1 */ public abstract @Nullable QName getElementName(@NotNull Object o) throws JAXBException;
/** * Gets the build information of the JAXB runtime. * * @return * may be null, if the runtime is loaded by a class loader that doesn't support * the access to the manifest informatino. */ public abstract @NotNull String getBuildId();
/** * Reads an annotation on the package that the given class belongs to. */ @Nullable <A extends Annotation> A getPackageAnnotation(Class<A> annotation, C clazz, Locatable srcpos);
/** * @since 2.0.3 */ public final @NotNull T unmarshal(@NotNull Node n, @Nullable AttachmentUnmarshaller au) throws JAXBException { Unmarshaller u = context.unmarshallerPool.take(); u.setAttachmentUnmarshaller(au); return exit(unmarshal(u,n),u); } public final @NotNull T unmarshal(@NotNull BridgeContext context, @NotNull Node n) throws JAXBException {
/** * Sends the result of the {@link #print(Object)} operation * to one of the {@link XMLSerializer#leafElement(Name, String, String)} method. * but with the best representation of the value, not necessarily String. */ void writeLeafElement(XMLSerializer w, Name tagName, @NotNull ValueT o, String fieldName) throws IOException, SAXException, XMLStreamException, AccessorException;
/** * Reads an annotation on a parameter of the method. * * @return null * if the annotation was not found. */ @Nullable <A extends Annotation> A getMethodParameterAnnotation( Class<A> annotation, M method, int paramIndex, Locatable srcPos );
/** * Gets the {@link JAXBRIContext} to which this object belongs. * * @since 2.1 */ public @NotNull JAXBRIContext getContext() { return context; }
/** * Fills in the data object by a portion of the byte[]. * * @param len * data[0] to data[len-1] are treated as the data. */ public void set(byte[] data, int len, @Nullable String mimeType) { this.data = data; this.dataLen = len; this.dataHandler = null; this.mimeType = mimeType; }
/** * Reads an annotation on a class. */ @Nullable <A extends Annotation> A getClassAnnotation(Class<A> annotation, C clazz, Locatable srcpos) ;
/** * Creates a mini-marshaller/unmarshaller that can process a {@link TypeReference}. * * @return * null if the specified reference is not given to {@link JAXBRIContext#newInstance}. * * @since 2.0 EA1 */ public abstract Bridge createBridge(@NotNull TypeReference ref);
/** * Transducers implicitly work against a single XML type, * but sometimes (most notably {@link XMLGregorianCalendar}, * an instance may choose different XML types. * * @return * return non-null from this method allows transducers * to specify the type it wants to marshal to. * Most of the time this method returns null, in which case * the implicitly associated type will be used. */ QName getTypeName(@NotNull ValueT instance); }