MarshallerImpl.java revision 23e304384f98fca4ab2e6f9f07a53465c1bfc645
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v1.0.6-b27-fcs
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2012.06.11 at 10:34:16 AM PDT
//
/**
* Implementation of {@link Marshaller} interface for JAXB RI.
*
* @author Kohsuke Kawaguchi
* @author Vivek Pandey
*/
public class MarshallerImpl extends AbstractMarshallerImpl
{
/** Indentation string. Default is four whitespaces. */
/** Used to assign prefixes to namespace URIs. */
/** Object that handles character escaping. */
/** Whether the xml declaration will be printed or not. */
private boolean printXmlDeclaration = true;
/** XML BLOB written after the XML declaration. */
/** reference to the context that created this object */
final DefaultJAXBContextImpl context;
public MarshallerImpl( DefaultJAXBContextImpl c ) {
// initialize datatype converter with ours
context = c;
}
//XMLSerializable so = Util.toXMLSerializable(obj);
throw new MarshalException(
return;
}
try {
} catch (ParserConfigurationException pce) {
throw new JAXBAssertionError(pce);
}
} else {
}
return;
}
if (result instanceof StreamResult) {
else
} // otherwise assume that it's a file name
try {
} catch (IOException e) {
throw new MarshalException(e);
}
}
if (w == null)
throw new IllegalArgumentException();
return;
}
// unsupported parameter type
throw new MarshalException(
}
throws JAXBException {
try {
// if we need to add xsi:schemaLocation or its brother,
// throw in the component to do that.
writer = new SchemaLocationFilter(
writer );
}
// set a DocumentLocator that doesn't provide any information
} catch( SAXException e ) {
throw new MarshalException(e);
}
}
//
//
// create XMLWriter by specifing various type of output.
//
//
if( escapeHandler!=null )
// user-specified one takes precedence.
return escapeHandler;
// no need for character reference. Use the handler
// optimized for that pattern.
return MinimumEscapeHandler.theInstance;
// otherwise try to find one from the encoding
try {
// try new JDK1.4 NIO
} catch( Throwable e ) {
// if that fails, fall back to the dumb mode
return DumbEscapeHandler.theInstance;
}
}
// buffering improves the performance
w = new BufferedWriter(w);
if(isFormattedOutput()) {
d.setIndentStep(indent);
xw=d;
}
else
return xw;
}
return createWriter(w, getEncoding());
}
}
try {
return createWriter(
encoding );
} catch( UnsupportedEncodingException e ) {
throw new MarshalException(
e );
}
}
return indent;
return escapeHandler;
return prefixMapper;
return header;
return super.getProperty(name);
}
return;
}
return;
}
return;
}
return;
}
return;
}
}
}