Class Bind


  • public class Bind
    extends Object
    Helper class for JAXB binding. Responsible for marshalling and unmarshalling using given schema and context.
    Author:
    loomchild
    • Constructor Detail

      • Bind

        public Bind​(JAXBContext context,
                    Schema schema)
        Creates Bind.
        Parameters:
        context - JAXB context
        schema - XML schema
    • Method Detail

      • marshal

        public void marshal​(Writer writer,
                            Object object)
        Writes given object to given writer validating it.
        Parameters:
        writer -
        object -
      • marshal

        public void marshal​(String fileName,
                            Object object)
        Writes given object to a file with given name validating it.
        Parameters:
        fileName -
        object -
      • unmarshal

        public Object unmarshal​(Reader reader)
        Retrieves object from given reader validation the input.
        Parameters:
        reader -
        Returns:
        object
      • unmarshal

        public Object unmarshal​(String fileName)
        Retrieves object from a file with given name validating the input.
        Parameters:
        fileName -
        Returns:
        object