Class DeploymentDescriptorFile<T extends Descriptor>

    • Constructor Detail

      • DeploymentDescriptorFile

        public DeploymentDescriptorFile()
        Creates a new instance of DeploymentDescriptorFile
    • Method Detail

      • getSAXParser

        public SAXParser getSAXParser()
        Returns:
        a non validating SAX Parser to read an XML file (containing Deployment Descriptors) into DOL descriptors
      • getSAXParser

        public SAXParser getSAXParser​(boolean validating)
        Parameters:
        validating - true if the parser should excercise DTD validation
        Returns:
        a SAX Parser to read an XML file (containing Deployment Descriptors) into DOL descriptors
      • getDocumentBuilder

        public DocumentBuilder getDocumentBuilder​(boolean validating)
        Parameters:
        validating - true if validation should happen
        Returns:
        a DOM parser to read XML File into a DOM tree
      • read

        public T read​(T descriptor,
                      File in)
               throws IOException,
                      SAXParseException
        read and parse a J2EE Deployment Descriptor input file and return the constructed DOL descriptors for the J2EE Module
        Parameters:
        descriptor - the read is incremental, the descriptor to apply the DDs to
        in - the input stream for the XML file
        Returns:
        the DOL descriptor for the J2EE Module
        Throws:
        IOException
        SAXParseException
      • read

        public T read​(T descriptor,
                      ReadableArchive in)
               throws IOException,
                      SAXParseException
        read and parse a J2EE Deployment Descriptor input file and return the constructed DOL descriptors for the J2EE Module
        Parameters:
        descriptor - the read is incremental, the descriptor to apply the DDs to
        in - the input archive abstraction for the XML file
        Returns:
        the DOL descriptor for the J2EE Module
        Throws:
        IOException
        SAXParseException
      • read

        public T read​(T descriptor,
                      InputStream is)
               throws IOException,
                      SAXParseException
        read and parse a J2EE Deployment Descriptor input file and return the constructed DOL descriptors for the J2EE Module
        Parameters:
        descriptor - if the read is incremental, the descriptor to apply the DDs to
        is - the input stream for the XML file
        Returns:
        the DOL descriptor for the J2EE Module
        Throws:
        IOException
        SAXParseException
      • getDocument

        public Document getDocument​(T descriptor)
        Parameters:
        descriptor -
        Returns:
        a Document for the passed descriptor
      • write

        public void write​(T descriptor,
                          OutputStream os)
                   throws IOException
        writes the descriptor to an output stream
        Parameters:
        descriptor - the descriptor
        os - the output stream
        Throws:
        IOException
      • write

        public void write​(T descriptor,
                          String path)
                   throws IOException
        writes the descriptor classes into a new XML file
        Parameters:
        descriptor - the DOL descriptor to write
        path - the file to use
        Throws:
        IOException
      • write

        public void write​(T descriptor,
                          File out)
                   throws IOException
        writes the descriptor classes into a new XML file
        Parameters:
        descriptor - the DOL descriptor to write
        out - the file to use
        Throws:
        IOException
      • getDeploymentDescriptorPath

        public abstract String getDeploymentDescriptorPath()
        Returns:
        the location of the deployment descriptor file for a particular type of Java EE Archive
      • getRootXMLNode

        public abstract RootXMLNode<T> getRootXMLNode​(T descriptor)
        Parameters:
        descriptor - the descriptor for which we need the node
        Returns:
        a RootXMLNode responsible for handling the deployment descriptors associated with this Java EE module
      • getXMLValidation

        protected boolean getXMLValidation()
        Returns:
        true if XML validation should be performed at load time
      • setXMLValidation

        public void setXMLValidation​(boolean validate)
        sets wether XML validation should be performed at load time
        Parameters:
        validate - true to validate
      • setXMLValidationLevel

        public void setXMLValidationLevel​(String level)
        Sets the xml validation error reporting/recovering level. The reporting level is active only when xml validation is turned on @see setXMLValidation. so far, two values can be passed, medium which reports the xml validation and continue and full which reports the xml validation and stop the xml parsing.
      • getXMLValidationLevel

        public String getXMLValidationLevel()
        Returns:
        the xml validation reporting level
      • getDefaultSchemaSource

        protected String getDefaultSchemaSource()
        Returns:
        the default schema source for this deployment descriptors
      • setErrorReportingString

        public void setErrorReportingString​(String s)
        Sets the error reporting string
      • getArchiveType

        public ArchiveType getArchiveType()
        Returns:
        the archive type associated with this deployment descriptor file
      • setArchiveType

        public void setArchiveType​(ArchiveType type)
        Parameters:
        the - archive type to set on this deployment descriptor file