All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javax.xml.bind.Marshaller Maven / Gradle / Ivy

There is a newer version: 6.0-6
Show newest version
/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package javax.xml.bind;

import java.io.OutputStream;
import java.io.Writer;
import java.io.File;

import javax.xml.bind.annotation.adapters.XmlAdapter;
import javax.xml.bind.attachment.AttachmentMarshaller;
import javax.xml.validation.Schema;
import javax.xml.transform.Result;
import javax.xml.stream.XMLEventWriter;
import javax.xml.stream.XMLStreamWriter;

import org.w3c.dom.Node;

import org.xml.sax.ContentHandler;

public interface Marshaller {

    String JAXB_ENCODING = "jaxb.encoding";
    String JAXB_FORMATTED_OUTPUT = "jaxb.formatted.output";
    String JAXB_FRAGMENT = "jaxb.fragment";
    String JAXB_NO_NAMESPACE_SCHEMA_LOCATION = "jaxb.noNamespaceSchemaLocation";
    String JAXB_SCHEMA_LOCATION = "jaxb.schemaLocation";

    abstract class Listener {
        public void beforeMarshal(Object source) {
        }
        public void afterMarshal(Object source) {
        }
    }

     A getAdapter(Class type);

    AttachmentMarshaller getAttachmentMarshaller();

    ValidationEventHandler getEventHandler() throws JAXBException;

    Listener getListener();

    Node getNode(Object contentTree) throws JAXBException;

    Object getProperty(String name) throws PropertyException;

    Schema getSchema();

    void marshal(Object jaxbElement, ContentHandler handler) throws JAXBException;

    void marshal(Object jaxbElement, File file) throws JAXBException;

    void marshal(Object jaxbElement, Node node) throws JAXBException;

    void marshal(Object jaxbElement, OutputStream os) throws JAXBException;

    void marshal(Object jaxbElement, Result result) throws JAXBException;

    void marshal(Object jaxbElement, Writer writer) throws JAXBException;

    void marshal(Object jaxbElement, XMLEventWriter writer) throws JAXBException;

    void marshal(Object jaxbElement, XMLStreamWriter writer) throws JAXBException;

     void setAdapter(Class type, A adapter);

    void setAdapter(XmlAdapter adapter);

    void setAttachmentMarshaller(AttachmentMarshaller am);

    void setEventHandler(ValidationEventHandler handler) throws JAXBException;

    void setListener(Listener listener);

    void setProperty(String name, Object value) throws PropertyException;

    void setSchema(Schema schema);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy