Package org.eclipse.jetty.webapp
Class MetaData
- java.lang.Object
-
- org.eclipse.jetty.webapp.MetaData
-
public class MetaData extends java.lang.ObjectMetaData 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 static ResourceNON_FRAG_RESOURCEstatic java.lang.StringORDERED_LIBSstatic java.lang.StringVALIDATE_XML
-
Constructor Summary
Constructors Constructor Description MetaData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddContainerResource(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(java.util.List<DiscoveredAnnotation> annotations)Annotations not associated with a WEB-INF/lib fragment jar.voidaddFragment(Resource jarResource, Resource xmlResource)Add a web-fragment.xmlvoidaddOverride(Resource override)voidaddWebInfJar(Resource newResource)voidclear()Empty ready for reusejava.util.List<Resource>getContainerResources()FragmentDescriptorgetFragment(java.lang.String name)FragmentDescriptorgetFragment(Resource jar)java.util.List<FragmentDescriptor>getFragments()ResourcegetJarForFragment(java.lang.String name)java.util.Map<java.lang.String,FragmentDescriptor>getNamedFragments()java.util.List<FragmentDescriptor>getOrderedFragments()java.util.List<Resource>getOrderedWebInfJars()OrderinggetOrdering()OrigingetOrigin(java.lang.String name)DescriptorgetOriginDescriptor(java.lang.String name)MetaData.OriginInfogetOriginInfo(java.lang.String name)java.util.Map<java.lang.String,MetaData.OriginInfo>getOrigins()java.util.List<WebDescriptor>getOverrideWebs()WebDescriptorgetWebDefault()java.util.List<Resource>getWebInfClassesDirs()java.util.List<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(Resource webDefaults)voidsetOrdering(Ordering o)voidsetOrigin(java.lang.String name, java.lang.annotation.Annotation annotation, java.lang.Class<?> annotated)voidsetOrigin(java.lang.String name, Descriptor d)voidsetOriginAPI(java.lang.String name)voidsetValidateXml(boolean validateXml)voidsetWebInfClassesDirs(java.util.List<Resource> dirs)voidsetWebXml(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
-
-
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()
-
-