Class ClassConverter

    • Field Detail

      • profile

        protected final EESpecProfile profile
        The configured spec profile.
    • Constructor Detail

      • ClassConverter

        public ClassConverter()
        Create a class converter with the default TOMCAT profile.
      • ClassConverter

        public ClassConverter​(EESpecProfile profile)
        Create a class converter with the specified spec profile.
        Parameters:
        profile - the specification profile to use for conversion
    • Method Detail

      • accepts

        public boolean accepts​(String filename)
        Description copied from interface: Converter
        Check if the file can be processed by this converter.
        Specified by:
        accepts in interface Converter
        Parameters:
        filename - the file name
        Returns:
        true if the converter will process this file
      • convert

        public boolean convert​(String path,
                               InputStream src,
                               OutputStream dest,
                               EESpecProfile profile)
                        throws IOException
        Description copied from interface: Converter
        Copies the source to the destination, converting it if necessary, according to the requirements of the given profile.
        Specified by:
        convert in interface Converter
        Parameters:
        path - The path to the data being converted
        src - The source data to convert
        dest - The destination to write the converted data
        profile - The profile that defines the conversion required
        Returns:
        true if the converter made a conversion to the file
        Throws:
        IOException - If the conversion fails
      • convertInternal

        protected boolean convertInternal​(String path,
                                          InputStream src,
                                          OutputStream dest,
                                          EESpecProfile profile,
                                          ClassLoader loader)
                                   throws IOException
        Convert specified class bytecode.
        Parameters:
        path - the path
        src - the source byte stream
        dest - the output byte stream
        profile - the specification profile to use
        loader - the class loader
        Returns:
        true if conversion occurred
        Throws:
        IOException - rethrow on byte read or write