Package org.eclipse.jetty.webapp
Class MetaData
- java.lang.Object
-
- org.eclipse.jetty.webapp.MetaData
-
public class MetaData extends java.lang.Object
MetaData All data associated with the configuration and deployment of a web application.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MetaData.OriginInfo
-
Field Summary
Fields Modifier and Type Field Description protected boolean
_allowDuplicateFragmentNames
protected java.util.Map<Resource,java.util.List<DiscoveredAnnotation>>
_annotations
protected java.util.List<DescriptorProcessor>
_descriptorProcessors
protected boolean
_metaDataComplete
protected java.util.List<Resource>
_orderedContainerResources
protected java.util.List<Resource>
_orderedWebInfResources
protected Ordering
_ordering
protected java.util.Map<java.lang.String,MetaData.OriginInfo>
_origins
protected boolean
_validateXml
protected WebDescriptor
_webDefaultsRoot
protected java.util.Map<java.lang.String,FragmentDescriptor>
_webFragmentNameMap
protected java.util.Map<Resource,FragmentDescriptor>
_webFragmentResourceMap
protected java.util.List<FragmentDescriptor>
_webFragmentRoots
protected java.util.List<Resource>
_webInfClasses
protected java.util.List<Resource>
_webInfJars
protected java.util.List<WebDescriptor>
_webOverrideRoots
protected WebDescriptor
_webXmlRoot
static Resource
NON_FRAG_RESOURCE
static java.lang.String
ORDERED_LIBS
static java.lang.String
VALIDATE_XML
-
Constructor Summary
Constructors Constructor Description MetaData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addContainerResource(Resource jar)
void
addDescriptorProcessor(DescriptorProcessor p)
void
addDiscoveredAnnotation(DiscoveredAnnotation annotation)
Add an annotation that has been discovered on a class, method or field within a resource eg a jar or dir.void
addDiscoveredAnnotations(java.util.List<DiscoveredAnnotation> annotations)
Annotations not associated with a WEB-INF/lib fragment jar.void
addFragment(Resource jarResource, Resource xmlResource)
Add a web-fragment.xmlvoid
addOverride(Resource override)
void
addWebInfJar(Resource newResource)
void
clear()
Empty ready for reusejava.util.List<Resource>
getContainerResources()
FragmentDescriptor
getFragment(java.lang.String name)
FragmentDescriptor
getFragment(Resource jar)
java.util.List<FragmentDescriptor>
getFragments()
Resource
getJarForFragment(java.lang.String name)
java.util.Map<java.lang.String,FragmentDescriptor>
getNamedFragments()
java.util.List<FragmentDescriptor>
getOrderedFragments()
java.util.List<Resource>
getOrderedWebInfJars()
Ordering
getOrdering()
Origin
getOrigin(java.lang.String name)
Descriptor
getOriginDescriptor(java.lang.String name)
MetaData.OriginInfo
getOriginInfo(java.lang.String name)
java.util.Map<java.lang.String,MetaData.OriginInfo>
getOrigins()
java.util.List<WebDescriptor>
getOverrideWebs()
WebDescriptor
getWebDefault()
java.util.List<Resource>
getWebInfClassesDirs()
java.util.List<Resource>
getWebInfJars()
WebDescriptor
getWebXml()
boolean
isAllowDuplicateFragmentNames()
boolean
isDistributable()
boolean
isMetaDataComplete()
boolean
isValidateXml()
void
orderFragments()
void
removeDescriptorProcessor(DescriptorProcessor p)
void
resolve(WebAppContext context)
Resolve all servlet/filter/listener metadata from all sources: descriptors and annotations.void
setAllowDuplicateFragmentNames(boolean allowDuplicateFragmentNames)
void
setDefaults(Resource webDefaults)
void
setOrdering(Ordering o)
void
setOrigin(java.lang.String name, java.lang.annotation.Annotation annotation, java.lang.Class<?> annotated)
void
setOrigin(java.lang.String name, Descriptor d)
void
setOriginAPI(java.lang.String name)
void
setValidateXml(boolean validateXml)
void
setWebInfClassesDirs(java.util.List<Resource> dirs)
void
setWebXml(Resource webXml)
-
-
-
Field Detail
-
VALIDATE_XML
public static final java.lang.String VALIDATE_XML
- See Also:
- Constant Field Values
-
ORDERED_LIBS
public static final java.lang.String ORDERED_LIBS
- See Also:
- Constant Field Values
-
NON_FRAG_RESOURCE
public static final Resource NON_FRAG_RESOURCE
-
_origins
protected java.util.Map<java.lang.String,MetaData.OriginInfo> _origins
-
_webDefaultsRoot
protected WebDescriptor _webDefaultsRoot
-
_webXmlRoot
protected WebDescriptor _webXmlRoot
-
_webOverrideRoots
protected final java.util.List<WebDescriptor> _webOverrideRoots
-
_metaDataComplete
protected boolean _metaDataComplete
-
_descriptorProcessors
protected final java.util.List<DescriptorProcessor> _descriptorProcessors
-
_webFragmentRoots
protected final java.util.List<FragmentDescriptor> _webFragmentRoots
-
_webFragmentNameMap
protected final java.util.Map<java.lang.String,FragmentDescriptor> _webFragmentNameMap
-
_webFragmentResourceMap
protected final java.util.Map<Resource,FragmentDescriptor> _webFragmentResourceMap
-
_annotations
protected final java.util.Map<Resource,java.util.List<DiscoveredAnnotation>> _annotations
-
_webInfClasses
protected final java.util.List<Resource> _webInfClasses
-
_webInfJars
protected final java.util.List<Resource> _webInfJars
-
_orderedContainerResources
protected final java.util.List<Resource> _orderedContainerResources
-
_orderedWebInfResources
protected final java.util.List<Resource> _orderedWebInfResources
-
_ordering
protected Ordering _ordering
-
_allowDuplicateFragmentNames
protected boolean _allowDuplicateFragmentNames
-
_validateXml
protected boolean _validateXml
-
-
Method Detail
-
clear
public void clear()
Empty ready for reuse
-
setDefaults
public void setDefaults(Resource webDefaults) throws java.lang.Exception
- Throws:
java.lang.Exception
-
setWebXml
public void setWebXml(Resource webXml) throws java.lang.Exception
- Throws:
java.lang.Exception
-
addOverride
public void addOverride(Resource override) throws java.lang.Exception
- Throws:
java.lang.Exception
-
addFragment
public void addFragment(Resource jarResource, Resource xmlResource) throws java.lang.Exception
Add a web-fragment.xml- Parameters:
jarResource
- the jar the fragment is contained inxmlResource
- the resource representing the xml file- Throws:
java.lang.Exception
- if unable to add fragment
-
addDiscoveredAnnotations
public void addDiscoveredAnnotations(java.util.List<DiscoveredAnnotation> annotations)
Annotations not associated with a WEB-INF/lib fragment jar. These are from WEB-INF/classes or the ??container path??- Parameters:
annotations
- the list of discovered annotations to add
-
addDiscoveredAnnotation
public void addDiscoveredAnnotation(DiscoveredAnnotation annotation)
Add an annotation that has been discovered on a class, method or field within a resource eg a jar or dir. This method is synchronized as it is anticipated that it may be called by many threads during the annotation scanning phase.- Parameters:
annotation
- the discovered annotation
-
addDescriptorProcessor
public void addDescriptorProcessor(DescriptorProcessor p)
-
removeDescriptorProcessor
public void removeDescriptorProcessor(DescriptorProcessor p)
-
orderFragments
public void orderFragments()
-
resolve
public void resolve(WebAppContext context) throws java.lang.Exception
Resolve all servlet/filter/listener metadata from all sources: descriptors and annotations.- Parameters:
context
- the context to resolve servlets / filters / listeners metadata from- Throws:
java.lang.Exception
- if unable to resolve metadata
-
isDistributable
public boolean isDistributable()
-
getWebXml
public WebDescriptor getWebXml()
-
getOverrideWebs
public java.util.List<WebDescriptor> getOverrideWebs()
-
getWebDefault
public WebDescriptor getWebDefault()
-
getFragments
public java.util.List<FragmentDescriptor> getFragments()
-
getOrderedWebInfJars
public java.util.List<Resource> getOrderedWebInfJars()
-
getOrderedFragments
public java.util.List<FragmentDescriptor> getOrderedFragments()
-
getOrdering
public Ordering getOrdering()
-
setOrdering
public void setOrdering(Ordering o)
-
getFragment
public FragmentDescriptor getFragment(Resource jar)
-
getFragment
public FragmentDescriptor getFragment(java.lang.String name)
-
getJarForFragment
public Resource getJarForFragment(java.lang.String name)
-
getNamedFragments
public java.util.Map<java.lang.String,FragmentDescriptor> getNamedFragments()
-
getOrigin
public Origin getOrigin(java.lang.String name)
-
getOriginInfo
public MetaData.OriginInfo getOriginInfo(java.lang.String name)
-
getOriginDescriptor
public Descriptor getOriginDescriptor(java.lang.String name)
-
setOrigin
public void setOrigin(java.lang.String name, Descriptor d)
-
setOrigin
public void setOrigin(java.lang.String name, java.lang.annotation.Annotation annotation, java.lang.Class<?> annotated)
-
setOriginAPI
public void setOriginAPI(java.lang.String name)
-
isMetaDataComplete
public boolean isMetaDataComplete()
-
addWebInfJar
public void addWebInfJar(Resource newResource)
-
getWebInfJars
public java.util.List<Resource> getWebInfJars()
-
getContainerResources
public java.util.List<Resource> getContainerResources()
-
addContainerResource
public void addContainerResource(Resource jar)
-
setWebInfClassesDirs
public void setWebInfClassesDirs(java.util.List<Resource> dirs)
-
getWebInfClassesDirs
public java.util.List<Resource> getWebInfClassesDirs()
-
isAllowDuplicateFragmentNames
public boolean isAllowDuplicateFragmentNames()
-
setAllowDuplicateFragmentNames
public void setAllowDuplicateFragmentNames(boolean allowDuplicateFragmentNames)
-
isValidateXml
public boolean isValidateXml()
- Returns:
- the validateXml
-
setValidateXml
public void setValidateXml(boolean validateXml)
- Parameters:
validateXml
- the validateXml to set
-
getOrigins
public java.util.Map<java.lang.String,MetaData.OriginInfo> getOrigins()
-
-