Package org.eclipse.jetty.quickstart
Class QuickStartDescriptorGenerator
java.lang.Object
org.eclipse.jetty.quickstart.QuickStartDescriptorGenerator
QuickStartDescriptorGenerator
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.annotations.javaTargetPlatform attribute should be set on the Context with the platform number of the target JVM (eg 8).
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionQuickStartDescriptorGenerator
(WebAppContext w, String extraXML, String originAttribute, boolean generateOrigin) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addContextParamFromAttribute
(XmlAppendable out, String attribute) Turn attribute into context-param to store.private void
addContextParamFromAttribute
(XmlAppendable out, String attribute, AttributeNormalizer normalizer) Turn context attribute into context-param to store.void
generateQuickStartWebXml
(OutputStream stream) Perform the generation of the xml fileFind the origin (web.xml, fragment, annotation etc) of a web artifact from MetaData.private void
outholder
(XmlAppendable out, MetaData md, FilterHolder holder) Generate xml for a Holder (Filter/Servlet)private void
outholder
(XmlAppendable out, MetaData md, ServletHolder holder)
-
Field Details
-
LOG
-
ORIGIN
- See Also:
-
DEFAULT_QUICKSTART_DESCRIPTOR_NAME
- See Also:
-
DEFAULT_ORIGIN_ATTRIBUTE_NAME
- See Also:
-
_webApp
-
_extraXML
-
_originAttribute
-
_generateOrigin
protected boolean _generateOrigin -
_count
protected int _count
-
-
Constructor Details
-
QuickStartDescriptorGenerator
public QuickStartDescriptorGenerator(WebAppContext w, String extraXML, String originAttribute, boolean generateOrigin) - Parameters:
w
- the source WebAppContextextraXML
- any extra xml snippet to appendoriginAttribute
- param value to use for the context param origin attributegenerateOrigin
-true
to generate the origin attribute
-
-
Method Details
-
generateQuickStartWebXml
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.xmlFileNotFoundException
- if unable to find the file
-
addContextParamFromAttribute
Turn attribute into context-param to store.- Throws:
IOException
-
addContextParamFromAttribute
private void addContextParamFromAttribute(XmlAppendable out, String attribute, AttributeNormalizer normalizer) throws IOException Turn context attribute into context-param to store.- Throws:
IOException
-
outholder
Generate xml for a Holder (Filter/Servlet)- Throws:
IOException
-
outholder
- Throws:
IOException
-
origin
Find the origin (web.xml, fragment, annotation etc) of a web artifact from MetaData.- Parameters:
md
- the metadataname
- the name- Returns:
- the origin map
-