Class MetaData


  • public class MetaData
    extends java.lang.Object
    MetaData All data associated with the configuration and deployment of a web application.
    • Field Detail

      • NON_FRAG_RESOURCE

        public static final Resource NON_FRAG_RESOURCE
      • _webOverrideRoots

        protected final java.util.List<WebDescriptor> _webOverrideRoots
      • _metaDataComplete

        protected boolean _metaDataComplete
      • _descriptorProcessors

        protected final java.util.List<DescriptorProcessor> _descriptorProcessors
      • _webFragmentNameMap

        protected final java.util.Map<java.lang.String,​FragmentDescriptor> _webFragmentNameMap
      • _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
    • Constructor Detail

      • MetaData

        public MetaData()
    • 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 in
        xmlResource - 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
      • 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()
      • getOverrideWebs

        public java.util.List<WebDescriptor> getOverrideWebs()
      • getOrderedWebInfJars

        public java.util.List<Resource> getOrderedWebInfJars()
      • getOrdering

        public Ordering getOrdering()
      • setOrdering

        public void setOrdering​(Ordering o)
      • 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)
      • 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