Class Bind

java.lang.Object
net.loomchild.segment.util.Bind

public class Bind extends Object
Helper class for JAXB binding. Responsible for marshalling and unmarshalling using given schema and context.
  • Field Details

  • Constructor Details

    • Bind

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

    • 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