Class QuickStartGeneratorConfiguration

java.lang.Object
org.eclipse.jetty.ee10.webapp.AbstractConfiguration
org.eclipse.jetty.ee10.quickstart.QuickStartGeneratorConfiguration
All Implemented Interfaces:
Configuration

public class QuickStartGeneratorConfiguration extends AbstractConfiguration
QuickStartGeneratorConfiguration

Generate an effective web.xml from a WebAppContext, including all components from web.xml, web-fragment.xmls annotations etc.

If generating quickstart for a different java platform than the current running platform, then the org.eclipse.jetty.ee10.annotations.javaTargetPlatform attribute should be set on the Context with the platform number of the target JVM (eg 8).

  • Field Details

    • ORIGIN

      public static final String ORIGIN
      See Also:
    • DEFAULT_ORIGIN_ATTRIBUTE_NAME

      public static final String DEFAULT_ORIGIN_ATTRIBUTE_NAME
      See Also:
    • _abort

      protected final boolean _abort
    • _originAttribute

      protected String _originAttribute
    • _count

      protected int _count
    • _quickStartWebXml

      protected Path _quickStartWebXml
  • Constructor Details

    • QuickStartGeneratorConfiguration

      public QuickStartGeneratorConfiguration()
    • QuickStartGeneratorConfiguration

      public QuickStartGeneratorConfiguration(boolean abort)
  • Method Details

    • abort

      public boolean abort(WebAppContext context)
      Specified by:
      abort in interface Configuration
      Overrides:
      abort in class AbstractConfiguration
      Returns:
      true if configuration should be aborted
    • setOriginAttribute

      public void setOriginAttribute(String name)
    • getOriginAttribute

      public String getOriginAttribute()
      Get the originAttribute.
      Returns:
      the originAttribute
    • getQuickStartWebXml

      public Path getQuickStartWebXml()
    • setQuickStartWebXml

      public void setQuickStartWebXml(Path quickStartWebXml)
    • generateQuickStartWebXml

      public void generateQuickStartWebXml(WebAppContext context, OutputStream stream) throws IOException
      Perform the generation of the xml file
      Parameters:
      stream - the stream to generate the quickstart-web.xml to
      Throws:
      IOException - if unable to generate the quickstart-web.xml
    • origin

      public Map<String,String> origin(MetaData md, String name)
      Find the origin (web.xml, fragment, annotation etc) of a web artifact from MetaData.
      Parameters:
      md - the metadata
      name - the name
      Returns:
      the origin map
    • preConfigure

      public void preConfigure(WebAppContext context) throws Exception
      Description copied from interface: Configuration
      Set up for configuration.

      Typically this step discovers configuration resources. Calls to preConfigure may alter the Configurations configured on the WebAppContext, so long as configurations prior to this configuration are not altered.

      Specified by:
      preConfigure in interface Configuration
      Overrides:
      preConfigure in class AbstractConfiguration
      Parameters:
      context - The context to configure
      Throws:
      Exception - if unable to pre configure
    • configure

      public void configure(WebAppContext context) throws Exception
      Description copied from interface: Configuration
      Configure WebApp.

      Typically this step applies the discovered configuration resources to either the WebAppContext or the associated MetaData.

      Specified by:
      configure in interface Configuration
      Overrides:
      configure in class AbstractConfiguration
      Parameters:
      context - The context to configure
      Throws:
      Exception - if unable to configure
    • deconfigure

      public void deconfigure(WebAppContext context) throws Exception
      Description copied from interface: Configuration
      DeConfigure WebApp. This method is called to undo all configuration done. This is called to allow the context to work correctly over a stop/start cycle
      Specified by:
      deconfigure in interface Configuration
      Overrides:
      deconfigure in class AbstractConfiguration
      Parameters:
      context - The context to configure
      Throws:
      Exception - if unable to deconfigure