This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.xml.bind.helpers
class AbstractMarshallerImpl

java.lang.Object extended by javax.xml.bind.helpers.AbstractMarshallerImpl
All Implemented Interfaces:
Marshaller

public abstract class AbstractMarshallerImpl
extends Object
implements Marshaller

Partial default Marshaller implementation.

This class provides a partial default implementation for the {@link javax.xml.bind.Marshaller} interface.

The only methods that a JAXB Provider has to implement are {@link Marshaller#marshal(Object, javax.xml.transform.Result) marshal(Object, javax.xml.transform.Result)}, {@link Marshaller#marshal(Object, javax.xml.transform.Result) marshal(Object, javax.xml.stream.XMLStreamWriter)}, and {@link Marshaller#marshal(Object, javax.xml.transform.Result) marshal(Object, javax.xml.stream.XMLEventWriter)}.


Constructor Summary

          
 
Method Summary
 XmlAdapter

          
 AttachmentMarshaller

          
protected String

          Convenience method for getting the current output encoding.
 ValidationEventHandler

          
protected String

          Gets the corresponding Java encoding name from an IANA name.
 Marshaller.Listener

          
 Node

          By default, the getNode method is unsupported and throw an java.lang.UnsupportedOperationException.
protected String

          Convenience method for getting the current noNamespaceSchemaLocation.
 Object

          Default implementation of the getProperty method handles the four defined properties in Marshaller.
 Schema

          
protected String

          Convenience method for getting the current schemaLocation.
protected boolean

          Convenience method for getting the formatted output flag.
protected boolean

          Convenience method for getting the fragment flag.
 void
marshal(Object obj, ContentHandler handler)

          
 void
marshal(Object jaxbElement, File output)

          
 void
marshal(Object obj, Node node)

          
 void

          
 void

          
 void

          
 void

          
 void
setAdapter(Class type, XmlAdapter adapter)

          
 void

          
 void

          
protected void
setEncoding(String encoding)

          Convenience method for setting the output encoding.
 void

          
protected void
setFormattedOutput(boolean v)

          Convenience method for setting the formatted output flag.
protected void
setFragment(boolean v)

          Convenience method for setting the fragment flag.
 void

          
protected void

          Convenience method for setting the noNamespaceSchemaLocation.
 void
setProperty(String name, Object value)

          Default implementation of the setProperty method handles the four defined properties in Marshaller.
 void
setSchema(Schema schema)

          
protected void

          Convenience method for setting the schemaLocation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMarshallerImpl

public AbstractMarshallerImpl()
Method Detail

getAdapter

public XmlAdapter getAdapter(Class type)
Parameters:
type

getAttachmentMarshaller

public AttachmentMarshaller getAttachmentMarshaller()

getEncoding

protected String getEncoding()
Convenience method for getting the current output encoding.

Returns:
the current encoding or "UTF-8" if it hasn't been set.

getEventHandler

public ValidationEventHandler getEventHandler()
                                       throws JAXBException
Throws:
JAXBException

getJavaEncoding

protected String getJavaEncoding(String encoding)
                          throws UnsupportedEncodingException
Gets the corresponding Java encoding name from an IANA name. This method is a helper method for the derived class to convert encoding names.

Parameters:
encoding
Throws:
UnsupportedEncodingException - If this implementation couldn't find the Java encoding name.

getListener

public Marshaller.Listener getListener()

getNode

public Node getNode(Object obj)
             throws JAXBException
By default, the getNode method is unsupported and throw an {@link java.lang.UnsupportedOperationException}. Implementations that choose to support this method must override this method.

Parameters:
obj
Throws:
JAXBException

getNoNSSchemaLocation

protected String getNoNSSchemaLocation()
Convenience method for getting the current noNamespaceSchemaLocation.

Returns:
the current noNamespaceSchemaLocation or null if it hasn't been set

getProperty

public Object getProperty(String name)
                   throws PropertyException
Default implementation of the getProperty method handles the four defined properties in Marshaller. If a provider needs to support additional provider specific properties, it should override this method in a derived class.

Parameters:
name
Throws:
PropertyException

getSchema

public Schema getSchema()

getSchemaLocation

protected String getSchemaLocation()
Convenience method for getting the current schemaLocation.

Returns:
the current schemaLocation or null if it hasn't been set

isFormattedOutput

protected boolean isFormattedOutput()
Convenience method for getting the formatted output flag.

Returns:
the current value of the formatted output flag or false if it hasn't been set.

isFragment

protected boolean isFragment()
Convenience method for getting the fragment flag.

Returns:
the current value of the fragment flag or false if it hasn't been set.

marshal

public final void marshal(Object obj,
                          ContentHandler handler)
                   throws JAXBException
Parameters:
obj
handler
Throws:
JAXBException

marshal

public void marshal(Object jaxbElement,
                    File output)
             throws JAXBException
Parameters:
jaxbElement
output
Throws:
JAXBException

marshal

public final void marshal(Object obj,
                          Node node)
                   throws JAXBException
Parameters:
obj
node
Throws:
JAXBException

marshal

public final void marshal(Object obj,
                          OutputStream os)
                   throws JAXBException
Parameters:
obj
os
Throws:
JAXBException

marshal

public final void marshal(Object obj,
                          Writer w)
                   throws JAXBException
Parameters:
obj
w
Throws:
JAXBException

marshal

public void marshal(Object obj,
                    XMLEventWriter writer)
             throws JAXBException
Parameters:
obj
writer
Throws:
JAXBException

marshal

public void marshal(Object obj,
                    XMLStreamWriter writer)
             throws JAXBException
Parameters:
obj
writer
Throws:
JAXBException

setAdapter

public void setAdapter(Class type,
                       XmlAdapter adapter)
Parameters:
type
adapter

setAdapter

public void setAdapter(XmlAdapter adapter)
Parameters:
adapter

setAttachmentMarshaller

public void setAttachmentMarshaller(AttachmentMarshaller am)
Parameters:
am

setEncoding

protected void setEncoding(String encoding)
Convenience method for setting the output encoding.

Parameters:
encoding - a valid encoding as specified in the Marshaller class documentation

setEventHandler

public void setEventHandler(ValidationEventHandler handler)
                     throws JAXBException
Parameters:
handler
Throws:
JAXBException

setFormattedOutput

protected void setFormattedOutput(boolean v)
Convenience method for setting the formatted output flag.

Parameters:
v - value of the formatted output flag.

setFragment

protected void setFragment(boolean v)
Convenience method for setting the fragment flag.

Parameters:
v - value of the fragment flag.

setListener

public void setListener(Marshaller.Listener listener)
Parameters:
listener

setNoNSSchemaLocation

protected void setNoNSSchemaLocation(String location)
Convenience method for setting the noNamespaceSchemaLocation.

Parameters:
location - the noNamespaceSchemaLocation value

setProperty

public void setProperty(String name,
                        Object value)
                 throws PropertyException
Default implementation of the setProperty method handles the four defined properties in Marshaller. If a provider needs to handle additional properties, it should override this method in a derived class.

Parameters:
name
value
Throws:
PropertyException

setSchema

public void setSchema(Schema schema)
Parameters:
schema

setSchemaLocation

protected void setSchemaLocation(String location)
Convenience method for setting the schemaLocation.

Parameters:
location - the schemaLocation value


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.