Class PageInfo

java.lang.Object
org.apache.jasper.compiler.PageInfo

public class PageInfo extends Object
A repository for various info about the translation unit under compilation.
  • Method Details

    • isTagFile

      public boolean isTagFile()
      Checks if this is a tag file.
      Returns:
      true if this is a tag file
    • isPluginDeclared

      public boolean isPluginDeclared(String id)
      Check if the plugin ID has been previously declared. Make a note that this Id is now declared.
      Parameters:
      id - The plugin ID to check
      Returns:
      true if Id has been declared.
    • addImports

      public void addImports(List<String> imports)
      Adds multiple imports to this page.
      Parameters:
      imports - The imports to add
    • addImport

      public void addImport(String imp)
      Adds a single import to this page.
      Parameters:
      imp - The import to add
    • getImports

      public List<String> getImports()
      Returns the list of imports for this page.
      Returns:
      The imports list
    • getJspFile

      public String getJspFile()
      Returns the JSP file path.
      Returns:
      The JSP file path
    • addDependant

      public void addDependant(String d, Long lastModified)
      Adds a dependent file to this page.
      Parameters:
      d - The dependent file path
      lastModified - The last modified timestamp
    • getDependants

      public Map<String,Long> getDependants()
      Returns the map of dependent files.
      Returns:
      The dependants map
    • getBeanRepository

      public BeanRepository getBeanRepository()
      Returns the bean repository for this page.
      Returns:
      The bean repository
    • setScriptless

      public void setScriptless(boolean s)
      Sets whether this page is scriptless.
      Parameters:
      s - true if the page is scriptless
    • isScriptless

      public boolean isScriptless()
      Checks if this page is scriptless.
      Returns:
      true if the page is scriptless
    • setScriptingInvalid

      public void setScriptingInvalid(boolean s)
      Sets whether scripting is invalid for this page.
      Parameters:
      s - true if scripting is invalid
    • isScriptingInvalid

      public boolean isScriptingInvalid()
      Checks if scripting is invalid for this page.
      Returns:
      true if scripting is invalid
    • getIncludePrelude

      public Collection<String> getIncludePrelude()
      Returns the collection of include prelude files.
      Returns:
      The include prelude files
    • setIncludePrelude

      public void setIncludePrelude(Collection<String> prelude)
      Sets the collection of include prelude files.
      Parameters:
      prelude - The include prelude files
    • getIncludeCoda

      public Collection<String> getIncludeCoda()
      Returns the collection of include coda files.
      Returns:
      The include coda files
    • setIncludeCoda

      public void setIncludeCoda(Collection<String> coda)
      Sets the collection of include coda files.
      Parameters:
      coda - The include coda files
    • setHasJspRoot

      public void setHasJspRoot(boolean s)
      Sets whether this page has a JSP root.
      Parameters:
      s - true if the page has a JSP root
    • hasJspRoot

      public boolean hasJspRoot()
      Checks if this page has a JSP root.
      Returns:
      true if the page has a JSP root
    • getOmitXmlDecl

      public String getOmitXmlDecl()
      Returns the omit XML declaration setting.
      Returns:
      The omit XML declaration value
    • setOmitXmlDecl

      public void setOmitXmlDecl(String omit)
      Sets the omit XML declaration setting.
      Parameters:
      omit - The omit XML declaration value
    • getDoctypeName

      public String getDoctypeName()
      Returns the DOCTYPE name.
      Returns:
      The DOCTYPE name
    • setDoctypeName

      public void setDoctypeName(String doctypeName)
      Sets the DOCTYPE name.
      Parameters:
      doctypeName - The DOCTYPE name
    • getDoctypeSystem

      public String getDoctypeSystem()
      Returns the DOCTYPE system identifier.
      Returns:
      The DOCTYPE system identifier
    • setDoctypeSystem

      public void setDoctypeSystem(String doctypeSystem)
      Sets the DOCTYPE system identifier.
      Parameters:
      doctypeSystem - The DOCTYPE system identifier
    • getDoctypePublic

      public String getDoctypePublic()
      Returns the DOCTYPE public identifier.
      Returns:
      The DOCTYPE public identifier
    • setDoctypePublic

      public void setDoctypePublic(String doctypePublic)
      Sets the DOCTYPE public identifier.
      Parameters:
      doctypePublic - The DOCTYPE public identifier
    • setIsJspPrefixHijacked

      public void setIsJspPrefixHijacked(boolean isHijacked)
      Sets whether the JSP prefix has been hijacked.
      Parameters:
      isHijacked - true if the JSP prefix has been hijacked
    • isJspPrefixHijacked

      public boolean isJspPrefixHijacked()
      Checks if the JSP prefix has been hijacked.
      Returns:
      true if the JSP prefix has been hijacked
    • addPrefix

      public void addPrefix(String prefix)
      Adds the given prefix to the set of prefixes of this translation unit.
      Parameters:
      prefix - The prefix to add
    • containsPrefix

      public boolean containsPrefix(String prefix)
      Checks to see if this translation unit contains the given prefix.
      Parameters:
      prefix - The prefix to check
      Returns:
      true if this translation unit contains the given prefix
    • addTaglib

      public void addTaglib(String uri, TagLibraryInfo info)
      Maps the given URI to the given tag library.
      Parameters:
      uri - The URI to map
      info - The tag library to be associated with the given URI
    • getTaglib

      public TagLibraryInfo getTaglib(String uri)
      Gets the tag library corresponding to the given URI.
      Parameters:
      uri - The URI to look up
      Returns:
      Tag library corresponding to the given URI
    • getTaglibs

      public Collection<TagLibraryInfo> getTaglibs()
      Gets the collection of tag libraries that are associated with a URI.
      Returns:
      Collection of tag libraries
    • hasTaglib

      public boolean hasTaglib(String uri)
      Checks to see if the given URI is mapped to a tag library.
      Parameters:
      uri - The URI to check
      Returns:
      true if the given URI is mapped to a tag library
    • addPrefixMapping

      public void addPrefixMapping(String prefix, String uri)
      Maps the given prefix to the given URI.
      Parameters:
      prefix - The prefix to map
      uri - The URI to be associated with the given prefix
    • pushPrefixMapping

      public void pushPrefixMapping(String prefix, String uri)
      Pushes the given URI onto the stack of URIs to which the given prefix is mapped.
      Parameters:
      prefix - The prefix whose stack of URIs is to be pushed
      uri - The URI to be pushed onto the stack
    • popPrefixMapping

      public void popPrefixMapping(String prefix)
      Removes the URI at the top of the stack of URIs to which the given prefix is mapped.
      Parameters:
      prefix - The prefix whose stack of URIs is to be popped
    • getURI

      public String getURI(String prefix)
      Returns the URI to which the given prefix maps.
      Parameters:
      prefix - The prefix whose URI is sought
      Returns:
      The URI to which the given prefix maps
    • setLanguage

      public void setLanguage(String value, Node n, ErrorDispatcher err, boolean pagedir) throws JasperException
      Sets the language attribute.
      Parameters:
      value - The language value
      n - The node
      err - The error dispatcher
      pagedir - Whether this is a page directive
      Throws:
      JasperException - if the language is not Java
    • getLanguage

      public String getLanguage(boolean useDefault)
      Returns the language attribute value.
      Parameters:
      useDefault - Whether to use the default if not set
      Returns:
      The language value
    • setExtends

      public void setExtends(String value)
      Sets the extends attribute value.
      Parameters:
      value - The extends value
    • getExtends

      public String getExtends(boolean useDefault)
      Gets the value of the 'extends' page directive attribute.
      Parameters:
      useDefault - TRUE if the default (org.apache.jasper.runtime.HttpJspBase) should be returned if this attribute has not been set, FALSE otherwise
      Returns:
      The value of the 'extends' page directive attribute, or the default (org.apache.jasper.runtime.HttpJspBase) if this attribute has not been set and useDefault is TRUE
    • getExtends

      public String getExtends()
      Gets the value of the 'extends' page directive attribute.
      Returns:
      The value of the 'extends' page directive attribute, or the default (org.apache.jasper.runtime.HttpJspBase) if this attribute has not been set
    • setContentType

      public void setContentType(String value)
      Sets the content type.
      Parameters:
      value - The content type value
    • getContentType

      public String getContentType()
      Returns the content type.
      Returns:
      The content type
    • setBufferValue

      public void setBufferValue(String value, Node n, ErrorDispatcher err) throws JasperException
      Sets the buffer value.
      Parameters:
      value - The buffer value
      n - The node
      err - The error dispatcher
      Throws:
      JasperException - if the buffer value is invalid
    • getBufferValue

      public String getBufferValue()
      Returns the buffer value.
      Returns:
      The buffer value
    • getBuffer

      public int getBuffer()
      Returns the buffer size in bytes.
      Returns:
      The buffer size
    • setSession

      public void setSession(String value, Node n, ErrorDispatcher err) throws JasperException
      Sets the session attribute.
      Parameters:
      value - The session value
      n - The node
      err - The error dispatcher
      Throws:
      JasperException - if the session value is invalid
    • getSession

      public String getSession()
      Returns the session attribute value.
      Returns:
      The session value
    • isSession

      public boolean isSession()
      Checks if session is enabled.
      Returns:
      true if session is enabled
    • setAutoFlush

      public void setAutoFlush(String value, Node n, ErrorDispatcher err) throws JasperException
      Sets the autoFlush attribute.
      Parameters:
      value - The autoFlush value
      n - The node
      err - The error dispatcher
      Throws:
      JasperException - if the autoFlush value is invalid
    • getAutoFlush

      public String getAutoFlush()
      Returns the autoFlush attribute value.
      Returns:
      The autoFlush value
    • isAutoFlush

      public boolean isAutoFlush()
      Checks if autoFlush is enabled.
      Returns:
      true if autoFlush is enabled
    • setInfo

      public void setInfo(String value)
      Sets the page info string.
      Parameters:
      value - The info string
    • getInfo

      public String getInfo()
      Returns the page info string.
      Returns:
      The info string
    • setErrorPage

      public void setErrorPage(String value)
      Sets the error page URL.
      Parameters:
      value - The error page URL
    • getErrorPage

      public String getErrorPage()
      Returns the error page URL.
      Returns:
      The error page URL
    • setIsErrorPage

      public void setIsErrorPage(String value, Node n, ErrorDispatcher err) throws JasperException
      Sets the isErrorPage attribute.
      Parameters:
      value - The isErrorPage value
      n - The node
      err - The error dispatcher
      Throws:
      JasperException - if the value is invalid
    • getIsErrorPage

      public String getIsErrorPage()
      Returns the isErrorPage attribute value.
      Returns:
      The isErrorPage value
    • isErrorPage

      public boolean isErrorPage()
      Checks if this page is an error page.
      Returns:
      true if this is an error page
    • setIsELIgnored

      public void setIsELIgnored(String value, Node n, ErrorDispatcher err, boolean pagedir) throws JasperException
      Sets the isELIgnored attribute.
      Parameters:
      value - The isELIgnored value
      n - The node
      err - The error dispatcher
      pagedir - Whether this is a page directive
      Throws:
      JasperException - if the value is invalid
    • setErrorOnELNotFound

      public void setErrorOnELNotFound(String value, Node n, ErrorDispatcher err, boolean pagedir) throws JasperException
      Sets the errorOnELNotFound attribute.
      Parameters:
      value - The errorOnELNotFound value
      n - The node
      err - The error dispatcher
      pagedir - Whether this is a page directive
      Throws:
      JasperException - if the value is invalid
    • setDeferredSyntaxAllowedAsLiteral

      public void setDeferredSyntaxAllowedAsLiteral(String value, Node n, ErrorDispatcher err, boolean pagedir) throws JasperException
      Sets the deferredSyntaxAllowedAsLiteral attribute.
      Parameters:
      value - The deferredSyntaxAllowedAsLiteral value
      n - The node
      err - The error dispatcher
      pagedir - Whether this is a page directive
      Throws:
      JasperException - if the value is invalid
    • setTrimDirectiveWhitespaces

      public void setTrimDirectiveWhitespaces(String value, Node n, ErrorDispatcher err, boolean pagedir) throws JasperException
      Sets the trimDirectiveWhitespaces attribute.
      Parameters:
      value - The trimDirectiveWhitespaces value
      n - The node
      err - The error dispatcher
      pagedir - Whether this is a page directive
      Throws:
      JasperException - if the value is invalid
    • setELIgnored

      public void setELIgnored(boolean s)
      Sets the EL ignored flag.
      Parameters:
      s - The EL ignored flag
    • getIsELIgnored

      public String getIsELIgnored()
      Returns the isELIgnored attribute value.
      Returns:
      The isELIgnored value
    • isELIgnored

      public boolean isELIgnored()
      Checks if EL is ignored.
      Returns:
      true if EL is ignored
    • setErrorOnELNotFound

      public void setErrorOnELNotFound(boolean s)
      Sets the error on EL not found flag.
      Parameters:
      s - The error on EL not found flag
    • getErrorOnELNotFound

      public String getErrorOnELNotFound()
      Returns the errorOnELNotFound attribute value.
      Returns:
      The errorOnELNotFound value
    • isErrorOnELNotFound

      public boolean isErrorOnELNotFound()
      Checks if error on EL not found is enabled.
      Returns:
      true if error on EL not found is enabled
    • putNonCustomTagPrefix

      public void putNonCustomTagPrefix(String prefix, Mark where)
      Puts a non-custom tag prefix in the map.
      Parameters:
      prefix - The prefix
      where - The mark location
    • getNonCustomTagPrefix

      public Mark getNonCustomTagPrefix(String prefix)
      Gets the mark for a non-custom tag prefix.
      Parameters:
      prefix - The prefix
      Returns:
      The mark location
    • getDeferredSyntaxAllowedAsLiteral

      public String getDeferredSyntaxAllowedAsLiteral()
      Returns the deferredSyntaxAllowedAsLiteral attribute value.
      Returns:
      The deferredSyntaxAllowedAsLiteral value
    • isDeferredSyntaxAllowedAsLiteral

      public boolean isDeferredSyntaxAllowedAsLiteral()
      Checks if deferred syntax is allowed as literal.
      Returns:
      true if deferred syntax is allowed as literal
    • setDeferredSyntaxAllowedAsLiteral

      public void setDeferredSyntaxAllowedAsLiteral(boolean isELDeferred)
      Sets whether deferred syntax is allowed as literal.
      Parameters:
      isELDeferred - true if deferred syntax is allowed
    • getExpressionFactory

      public ExpressionFactory getExpressionFactory()
      Returns the expression factory.
      Returns:
      The expression factory
    • getTrimDirectiveWhitespaces

      public String getTrimDirectiveWhitespaces()
      Returns the trimDirectiveWhitespaces attribute value.
      Returns:
      The trimDirectiveWhitespaces value
    • isTrimDirectiveWhitespaces

      public boolean isTrimDirectiveWhitespaces()
      Checks if directive whitespaces are trimmed.
      Returns:
      true if directive whitespaces are trimmed
    • setTrimDirectiveWhitespaces

      public void setTrimDirectiveWhitespaces(boolean trimDirectiveWhitespaces)
      Sets whether directive whitespaces are trimmed.
      Parameters:
      trimDirectiveWhitespaces - true if directive whitespaces are trimmed
    • getVarInfoNames

      public Set<String> getVarInfoNames()
      Returns the set of variable info names.
      Returns:
      The variable info names
    • isErrorOnUndeclaredNamespace

      public boolean isErrorOnUndeclaredNamespace()
      Checks if error on undeclared namespace is enabled.
      Returns:
      true if error on undeclared namespace is enabled
    • setErrorOnUndeclaredNamespace

      public void setErrorOnUndeclaredNamespace(boolean errorOnUndeclaredNamespace)
      Sets whether error on undeclared namespace is enabled.
      Parameters:
      errorOnUndeclaredNamespace - true if error on undeclared namespace is enabled