org.exolab.castor.xml.Marshaller Java Examples

The following examples show how to use org.exolab.castor.xml.Marshaller. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CastorMarshaller.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Override
protected void marshalWriter(Object graph, Writer writer) throws XmlMappingException, IOException {
	Assert.state(this.xmlContext != null, "CastorMarshaller not initialized");
	Marshaller marshaller = this.xmlContext.createMarshaller();
	marshaller.setWriter(writer);
	doMarshal(graph, marshaller);
}
 
Example #2
Source File: CastorMarshaller.java    From java-technology-stack with MIT License 5 votes vote down vote up
private void doMarshal(Object graph, Marshaller marshaller) {
	try {
		customizeMarshaller(marshaller);
		marshaller.marshal(graph);
	}
	catch (XMLException ex) {
		throw convertCastorException(ex, true);
	}
}
 
Example #3
Source File: UncertaintyWriter.java    From OpenDA with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void write() throws IOException, ValidationException, MarshalException {

        String rootElement = "uncertainties" ;
        Marshaller marshaller = new Marshaller(writer);
        marshaller.setRootElement(rootElement);

        //if (variables != null && variables.containsKey("UA_SCHEMALOCATION"))
        //    marshaller.setSchemaLocation("http://www.wldelft.nl " + variables.getValue("UA_SCHEMALOCATION") + rootElement + ".xsd");
        //else
            marshaller.setSchemaLocation("http://www.wldelft.nl http://datools.wldelft.nl/schemas/v1.3/" + rootElement + ".xsd");

        marshaller.marshal(this.uncertaintiesComplexType);
    }
 
Example #4
Source File: Castor.java    From marshalsec with MIT License 5 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @see marshalsec.MarshallerBase#marshal(java.lang.Object)
 */
@Override
public String marshal ( Object o ) throws Exception {
    XMLContext context = new XMLContext();
    Marshaller m = context.createMarshaller();
    StringWriter sw = new StringWriter();
    m.setWriter(sw);
    return sw.toString();
}
 
Example #5
Source File: CastorMarshaller.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Override
protected void marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler)
		throws XmlMappingException {

	Marshaller marshaller = xmlContext.createMarshaller();
	marshaller.setContentHandler(contentHandler);
	doMarshal(graph, marshaller);
}
 
Example #6
Source File: CastorMarshaller.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
private void doMarshal(Object graph, Marshaller marshaller) {
	try {
		customizeMarshaller(marshaller);
		marshaller.marshal(graph);
	}
	catch (XMLException ex) {
		throw convertCastorException(ex, true);
	}
}
 
Example #7
Source File: Where.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param out
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 */
public void marshal(
        final java.io.Writer out)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, out);
}
 
Example #8
Source File: Select.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param out
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 */
public void marshal(
        final java.io.Writer out)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, out);
}
 
Example #9
Source File: Operand2.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param out
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 */
public void marshal(
        final java.io.Writer out)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, out);
}
 
Example #10
Source File: Query.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param out
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 */
public void marshal(
        final java.io.Writer out)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, out);
}
 
Example #11
Source File: Operator.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param handler
 * @throws java.io.IOException if an IOException occurs during
 * marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 */
public void marshal(
        final org.xml.sax.ContentHandler handler)
throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, handler);
}
 
Example #12
Source File: InExpression.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param out
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 */
public void marshal(
        final java.io.Writer out)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, out);
}
 
Example #13
Source File: Table.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param out
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 */
public void marshal(
        final java.io.Writer out)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, out);
}
 
Example #14
Source File: Select.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param handler
 * @throws java.io.IOException if an IOException occurs during
 * marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 */
public void marshal(
        final org.xml.sax.ContentHandler handler)
throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, handler);
}
 
Example #15
Source File: InExpr.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param out
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 */
public void marshal(
        final java.io.Writer out)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, out);
}
 
Example #16
Source File: DefineVariableType.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param out
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 */
public void marshal(
        final java.io.Writer out)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, out);
}
 
Example #17
Source File: GroupByType.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param out
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 */
public void marshal(
        final java.io.Writer out)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, out);
}
 
Example #18
Source File: IsNullExprType.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param handler
 * @throws java.io.IOException if an IOException occurs during
 * marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 */
public void marshal(
        final org.xml.sax.ContentHandler handler)
throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, handler);
}
 
Example #19
Source File: ExpressionGroup.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param handler
 * @throws java.io.IOException if an IOException occurs during
 * marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 */
public void marshal(
        final org.xml.sax.ContentHandler handler)
throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, handler);
}
 
Example #20
Source File: ExpressionGroup.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param out
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 */
public void marshal(
        final java.io.Writer out)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, out);
}
 
Example #21
Source File: GroupByType.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param handler
 * @throws java.io.IOException if an IOException occurs during
 * marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 */
public void marshal(
        final org.xml.sax.ContentHandler handler)
throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, handler);
}
 
Example #22
Source File: Value.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param out
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 */
public void marshal(
        final java.io.Writer out)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, out);
}
 
Example #23
Source File: BinaryExprType.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param handler
 * @throws java.io.IOException if an IOException occurs during
 * marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 */
public void marshal(
        final org.xml.sax.ContentHandler handler)
throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, handler);
}
 
Example #24
Source File: BinaryExprType.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param out
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 */
public void marshal(
        final java.io.Writer out)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, out);
}
 
Example #25
Source File: BinaryExpressionType.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param handler
 * @throws java.io.IOException if an IOException occurs during
 * marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 */
public void marshal(
        final org.xml.sax.ContentHandler handler)
throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, handler);
}
 
Example #26
Source File: Operator.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param out
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 */
public void marshal(
        final java.io.Writer out)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, out);
}
 
Example #27
Source File: UserValue.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param handler
 * @throws java.io.IOException if an IOException occurs during
 * marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 */
public void marshal(
        final org.xml.sax.ContentHandler handler)
throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, handler);
}
 
Example #28
Source File: SelectType.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param out
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 */
public void marshal(
        final java.io.Writer out)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, out);
}
 
Example #29
Source File: TableType.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param handler
 * @throws java.io.IOException if an IOException occurs during
 * marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 */
public void marshal(
        final org.xml.sax.ContentHandler handler)
throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, handler);
}
 
Example #30
Source File: IsNullExpression.java    From ralasafe with MIT License 2 votes vote down vote up
/**
 * 
 * 
 * @param out
 * @throws org.exolab.castor.xml.MarshalException if object is
 * null or if any SAXException is thrown during marshaling
 * @throws org.exolab.castor.xml.ValidationException if this
 * object is an invalid instance according to the schema
 */
public void marshal(
        final java.io.Writer out)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
    Marshaller.marshal(this, out);
}