Methods Summary |
---|
private void | checkBoolean(java.lang.String name, java.lang.Object value)
if(!(value instanceof Boolean))
throw new PropertyException(
Messages.format( Messages.MUST_BE_BOOLEAN, name ) );
|
private void | checkNotNull(java.lang.Object o1, java.lang.String o1Name, java.lang.Object o2, java.lang.String o2Name)
if( o1 == null ) {
throw new IllegalArgumentException(
Messages.format( Messages.MUST_NOT_BE_NULL, o1Name ) );
}
if( o2 == null ) {
throw new IllegalArgumentException(
Messages.format( Messages.MUST_NOT_BE_NULL, o2Name ) );
}
|
private void | checkString(java.lang.String name, java.lang.Object value)
if(!(value instanceof String))
throw new PropertyException(
Messages.format( Messages.MUST_BE_STRING, name ) );
|
public A | getAdapter(java.lang.Class type)
throw new UnsupportedOperationException();
|
public javax.xml.bind.attachment.AttachmentMarshaller | getAttachmentMarshaller()
throw new UnsupportedOperationException();
|
protected java.lang.String | getEncoding()Convenience method for getting the current output encoding.
return encoding;
|
public javax.xml.bind.ValidationEventHandler | getEventHandler()
return eventHandler;
|
protected java.lang.String | getJavaEncoding(java.lang.String encoding)Gets the corresponding Java encoding name from an IANA name.
This method is a helper method for the derived class to convert
encoding names.
try {
"1".getBytes(encoding);
return encoding;
} catch( UnsupportedEncodingException e ) {
// try known alias
for( int i=0; i<aliases.length; i+=2 ) {
if(encoding.equals(aliases[i])) {
"1".getBytes(aliases[i+1]);
return aliases[i+1];
}
}
throw new UnsupportedEncodingException(encoding);
}
/* J2SE1.4 feature
try {
this.encoding = Charset.forName( _encoding );
} catch( UnsupportedCharsetException uce ) {
throw new JAXBException( uce );
}
*/
|
public Listener | getListener()
throw new UnsupportedOperationException();
|
protected java.lang.String | getNoNSSchemaLocation()Convenience method for getting the current noNamespaceSchemaLocation.
return noNSSchemaLocation;
|
public org.w3c.dom.Node | getNode(java.lang.Object obj)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.
checkNotNull( obj, "obj", Boolean.TRUE, "foo" );
throw new UnsupportedOperationException();
|
public java.lang.Object | getProperty(java.lang.String name)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.
if( name == null ) {
throw new IllegalArgumentException(
Messages.format( Messages.MUST_NOT_BE_NULL, "name" ) );
}
// recognize and handle four pre-defined properties.
if( JAXB_ENCODING.equals(name) )
return getEncoding();
if( JAXB_FORMATTED_OUTPUT.equals(name) )
return isFormattedOutput()?Boolean.TRUE:Boolean.FALSE;
if( JAXB_NO_NAMESPACE_SCHEMA_LOCATION.equals(name) )
return getNoNSSchemaLocation();
if( JAXB_SCHEMA_LOCATION.equals(name) )
return getSchemaLocation();
if( JAXB_FRAGMENT.equals(name) )
return isFragment()?Boolean.TRUE:Boolean.FALSE;
throw new PropertyException(name);
|
public javax.xml.validation.Schema | getSchema()
throw new UnsupportedOperationException();
|
protected java.lang.String | getSchemaLocation()Convenience method for getting the current schemaLocation.
return schemaLocation;
|
protected boolean | isFormattedOutput()Convenience method for getting the formatted output flag.
return formattedOutput;
|
protected boolean | isFragment()Convenience method for getting the fragment flag.
return fragment;
|
public final void | marshal(java.lang.Object obj, java.io.OutputStream os)
checkNotNull( obj, "obj", os, "os" );
marshal( obj, new StreamResult(os) );
|
public void | marshal(java.lang.Object jaxbElement, java.io.File output)
checkNotNull(jaxbElement, "jaxbElement", output, "output" );
try {
OutputStream os = new BufferedOutputStream(new FileOutputStream(output));
try {
marshal( jaxbElement, new StreamResult(os) );
} finally {
os.close();
}
} catch (IOException e) {
throw new JAXBException(e);
}
|
public void | marshal(java.lang.Object obj, javax.xml.stream.XMLEventWriter writer)
throw new UnsupportedOperationException();
|
public void | marshal(java.lang.Object obj, javax.xml.stream.XMLStreamWriter writer)
throw new UnsupportedOperationException();
|
public final void | marshal(java.lang.Object obj, java.io.Writer w)
checkNotNull( obj, "obj", w, "writer" );
marshal( obj, new StreamResult(w) );
|
public final void | marshal(java.lang.Object obj, org.xml.sax.ContentHandler handler)
checkNotNull( obj, "obj", handler, "handler" );
marshal( obj, new SAXResult(handler) );
|
public final void | marshal(java.lang.Object obj, org.w3c.dom.Node node)
checkNotNull( obj, "obj", node, "node" );
marshal( obj, new DOMResult(node) );
|
public void | setAdapter(javax.xml.bind.annotation.adapters.XmlAdapter adapter)
if(adapter==null)
throw new IllegalArgumentException();
setAdapter((Class)adapter.getClass(),adapter);
|
public void | setAdapter(java.lang.Class type, A adapter)
throw new UnsupportedOperationException();
|
public void | setAttachmentMarshaller(javax.xml.bind.attachment.AttachmentMarshaller am)
throw new UnsupportedOperationException();
|
protected void | setEncoding(java.lang.String encoding)Convenience method for setting the output encoding.
this.encoding = encoding;
|
public void | setEventHandler(javax.xml.bind.ValidationEventHandler handler)
if( handler == null ) {
eventHandler = new DefaultValidationEventHandler();
} else {
eventHandler = handler;
}
|
protected void | setFormattedOutput(boolean v)Convenience method for setting the formatted output flag.
formattedOutput = v;
|
protected void | setFragment(boolean v)Convenience method for setting the fragment flag.
fragment = v;
|
public void | setListener(Listener listener)
throw new UnsupportedOperationException();
|
protected void | setNoNSSchemaLocation(java.lang.String location)Convenience method for setting the noNamespaceSchemaLocation.
noNSSchemaLocation = location;
|
public void | setProperty(java.lang.String name, java.lang.Object value)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.
if( name == null ) {
throw new IllegalArgumentException(
Messages.format( Messages.MUST_NOT_BE_NULL, "name" ) );
}
// recognize and handle four pre-defined properties.
if( JAXB_ENCODING.equals(name) ) {
checkString( name, value );
setEncoding( (String)value );
return;
}
if( JAXB_FORMATTED_OUTPUT.equals(name) ) {
checkBoolean( name, value );
setFormattedOutput((Boolean) value );
return;
}
if( JAXB_NO_NAMESPACE_SCHEMA_LOCATION.equals(name) ) {
checkString( name, value );
setNoNSSchemaLocation( (String)value );
return;
}
if( JAXB_SCHEMA_LOCATION.equals(name) ) {
checkString( name, value );
setSchemaLocation( (String)value );
return;
}
if( JAXB_FRAGMENT.equals(name) ) {
checkBoolean(name, value);
setFragment((Boolean) value );
return;
}
throw new PropertyException(name, value);
|
public void | setSchema(javax.xml.validation.Schema schema)
throw new UnsupportedOperationException();
|
protected void | setSchemaLocation(java.lang.String location)Convenience method for setting the schemaLocation.
schemaLocation = location;
|