Class JaxbXmlSchemaGenerator

java.lang.Object
org.opencastproject.util.JaxbXmlSchemaGenerator

public final class JaxbXmlSchemaGenerator extends Object
Provides utility methods for transforming a JAXBContext into an XML schema.
  • Method Details

    • getXmlSchema

      public static String getXmlSchema(javax.xml.bind.JAXBContext jaxbContext) throws IOException
      Builds an xml schema from a JAXBContext.
      Parameters:
      jaxbContext - the jaxb context
      Returns:
      the xml as a string
      Throws:
      IOException - if the JAXBContext can not be transformed into an xml schema
    • getXmlSchema

      public static String getXmlSchema(Class<?> clazz)
      Builds an xml schema. If the class is not XmlType or XmlRootElement annotated, return null;
      Parameters:
      clazz - the jaxb annotated class
      Returns:
      the xml as a string, or null if the class can not be transformed to a schema