Package org.eclipse.jetty.webapp
Class MetaData
- java.lang.Object
-
- org.eclipse.jetty.webapp.MetaData
-
public class MetaData extends 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 classMetaData.OriginInfo
-
Field Summary
Fields Modifier and Type Field Description protected boolean_allowDuplicateFragmentNamesprotected Map<org.eclipse.jetty.util.resource.Resource,List<DiscoveredAnnotation>>_annotationsprotected List<DescriptorProcessor>_descriptorProcessorsprotected boolean_metaDataCompleteprotected List<org.eclipse.jetty.util.resource.Resource>_orderedContainerResourcesprotected List<org.eclipse.jetty.util.resource.Resource>_orderedWebInfResourcesprotected Ordering_orderingprotected Map<String,MetaData.OriginInfo>_originsprotected boolean_validateXmlprotected WebDescriptor_webDefaultsRootprotected Map<String,FragmentDescriptor>_webFragmentNameMapprotected Map<org.eclipse.jetty.util.resource.Resource,FragmentDescriptor>_webFragmentResourceMapprotected List<FragmentDescriptor>_webFragmentRootsprotected List<org.eclipse.jetty.util.resource.Resource>_webInfClassesprotected List<org.eclipse.jetty.util.resource.Resource>_webInfJarsprotected List<WebDescriptor>_webOverrideRootsprotected WebDescriptor_webXmlRootstatic org.eclipse.jetty.util.resource.ResourceNON_FRAG_RESOURCEstatic StringORDERED_LIBSstatic StringVALIDATE_XML
-
Constructor Summary
Constructors Constructor Description MetaData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddContainerResource(org.eclipse.jetty.util.resource.Resource jar)voidaddDescriptorProcessor(DescriptorProcessor p)voidaddDiscoveredAnnotation(DiscoveredAnnotation annotation)Add an annotation that has been discovered on a class, method or field within a resource eg a jar or dir.voidaddDiscoveredAnnotations(List<DiscoveredAnnotation> annotations)Annotations not associated with a WEB-INF/lib fragment jar.voidaddFragment(org.eclipse.jetty.util.resource.Resource jarResource, org.eclipse.jetty.util.resource.Resource xmlResource)Add a web-fragment.xmlvoidaddOverride(org.eclipse.jetty.util.resource.Resource override)voidaddWebInfJar(org.eclipse.jetty.util.resource.Resource newResource)voidclear()Empty ready for reuseList<org.eclipse.jetty.util.resource.Resource>getContainerResources()FragmentDescriptorgetFragment(String name)FragmentDescriptorgetFragment(org.eclipse.jetty.util.resource.Resource jar)List<FragmentDescriptor>getFragments()org.eclipse.jetty.util.resource.ResourcegetJarForFragment(String name)Map<String,FragmentDescriptor>getNamedFragments()List<FragmentDescriptor>getOrderedFragments()List<org.eclipse.jetty.util.resource.Resource>getOrderedWebInfJars()OrderinggetOrdering()OrigingetOrigin(String name)DescriptorgetOriginDescriptor(String name)MetaData.OriginInfogetOriginInfo(String name)Map<String,MetaData.OriginInfo>getOrigins()List<WebDescriptor>getOverrideWebs()WebDescriptorgetWebDefault()List<org.eclipse.jetty.util.resource.Resource>getWebInfClassesDirs()List<org.eclipse.jetty.util.resource.Resource>getWebInfJars()WebDescriptorgetWebXml()booleanisAllowDuplicateFragmentNames()booleanisDistributable()booleanisMetaDataComplete()booleanisValidateXml()voidorderFragments()voidremoveDescriptorProcessor(DescriptorProcessor p)voidresolve(WebAppContext context)Resolve all servlet/filter/listener metadata from all sources: descriptors and annotations.voidsetAllowDuplicateFragmentNames(boolean allowDuplicateFragmentNames)voidsetDefaults(org.eclipse.jetty.util.resource.Resource webDefaults)voidsetOrdering(Ordering o)voidsetOrigin(String name, Annotation annotation, Class<?> annotated)voidsetOrigin(String name, Descriptor d)voidsetOriginAPI(String name)voidsetValidateXml(boolean validateXml)voidsetWebInfClassesDirs(List<org.eclipse.jetty.util.resource.Resource> dirs)voidsetWebXml(org.eclipse.jetty.util.resource.Resource webXml)
-
-
-
Field Detail
-
VALIDATE_XML
public static final String VALIDATE_XML
- See Also:
- Constant Field Values
-
ORDERED_LIBS
public static final String ORDERED_LIBS
- See Also:
- Constant Field Values
-
NON_FRAG_RESOURCE
public static final org.eclipse.jetty.util.resource.Resource NON_FRAG_RESOURCE
-
_origins
protected Map<String,MetaData.OriginInfo> _origins
-
_webDefaultsRoot
protected WebDescriptor _webDefaultsRoot
-
_webXmlRoot
protected WebDescriptor _webXmlRoot
-
_webOverrideRoots
protected final List<WebDescriptor> _webOverrideRoots
-
_metaDataComplete
protected boolean _metaDataComplete
-
_descriptorProcessors
protected final List<DescriptorProcessor> _descriptorProcessors
-
_webFragmentRoots
protected final List<FragmentDescriptor> _webFragmentRoots
-
_webFragmentNameMap
protected final Map<String,FragmentDescriptor> _webFragmentNameMap
-
_webFragmentResourceMap
protected final Map<org.eclipse.jetty.util.resource.Resource,FragmentDescriptor> _webFragmentResourceMap
-
_annotations
protected final Map<org.eclipse.jetty.util.resource.Resource,List<DiscoveredAnnotation>> _annotations
-
_webInfClasses
protected final List<org.eclipse.jetty.util.resource.Resource> _webInfClasses
-
_webInfJars
protected final List<org.eclipse.jetty.util.resource.Resource> _webInfJars
-
_orderedContainerResources
protected final List<org.eclipse.jetty.util.resource.Resource> _orderedContainerResources
-
_orderedWebInfResources
protected final List<org.eclipse.jetty.util.resource.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(org.eclipse.jetty.util.resource.Resource webDefaults) throws Exception- Throws:
Exception
-
setWebXml
public void setWebXml(org.eclipse.jetty.util.resource.Resource webXml) throws Exception- Throws:
Exception
-
addOverride
public void addOverride(org.eclipse.jetty.util.resource.Resource override) throws Exception- Throws:
Exception
-
addFragment
public void addFragment(org.eclipse.jetty.util.resource.Resource jarResource, org.eclipse.jetty.util.resource.Resource xmlResource) throws ExceptionAdd a web-fragment.xml- Parameters:
jarResource- the jar the fragment is contained inxmlResource- the resource representing the xml file- Throws:
Exception- if unable to add fragment
-
addDiscoveredAnnotations
public void addDiscoveredAnnotations(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 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:
Exception- if unable to resolve metadata
-
isDistributable
public boolean isDistributable()
-
getWebXml
public WebDescriptor getWebXml()
-
getOverrideWebs
public List<WebDescriptor> getOverrideWebs()
-
getWebDefault
public WebDescriptor getWebDefault()
-
getFragments
public List<FragmentDescriptor> getFragments()
-
getOrderedWebInfJars
public List<org.eclipse.jetty.util.resource.Resource> getOrderedWebInfJars()
-
getOrderedFragments
public List<FragmentDescriptor> getOrderedFragments()
-
getOrdering
public Ordering getOrdering()
-
setOrdering
public void setOrdering(Ordering o)
-
getFragment
public FragmentDescriptor getFragment(org.eclipse.jetty.util.resource.Resource jar)
-
getFragment
public FragmentDescriptor getFragment(String name)
-
getJarForFragment
public org.eclipse.jetty.util.resource.Resource getJarForFragment(String name)
-
getNamedFragments
public Map<String,FragmentDescriptor> getNamedFragments()
-
getOriginInfo
public MetaData.OriginInfo getOriginInfo(String name)
-
getOriginDescriptor
public Descriptor getOriginDescriptor(String name)
-
setOrigin
public void setOrigin(String name, Descriptor d)
-
setOrigin
public void setOrigin(String name, Annotation annotation, Class<?> annotated)
-
setOriginAPI
public void setOriginAPI(String name)
-
isMetaDataComplete
public boolean isMetaDataComplete()
-
addWebInfJar
public void addWebInfJar(org.eclipse.jetty.util.resource.Resource newResource)
-
getWebInfJars
public List<org.eclipse.jetty.util.resource.Resource> getWebInfJars()
-
getContainerResources
public List<org.eclipse.jetty.util.resource.Resource> getContainerResources()
-
addContainerResource
public void addContainerResource(org.eclipse.jetty.util.resource.Resource jar)
-
setWebInfClassesDirs
public void setWebInfClassesDirs(List<org.eclipse.jetty.util.resource.Resource> dirs)
-
getWebInfClassesDirs
public List<org.eclipse.jetty.util.resource.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 Map<String,MetaData.OriginInfo> getOrigins()
-
-