Class GspApp

java.lang.Object
ru.vyarus.guicey.gsp.info.model.GspApp

public class GspApp extends Object
Information model for registered gsp application.
Since:
03.12.2019
  • Constructor Details

    • GspApp

      public GspApp()
  • Method Details

    • getName

      public String getName()
      Returns:
      application name
    • setName

      public void setName(String name)
    • isMainContext

      public boolean isMainContext()
      Returns:
      true for main context, false for admin
    • setMainContext

      public void setMainContext(boolean mainContext)
    • getMappingUrl

      public String getMappingUrl()
      Returns:
      application mapping url (relative to context)
    • setMappingUrl

      public void setMappingUrl(String mappingUrl)
    • getRootUrl

      public String getRootUrl()
      Returns:
      application mapping url prefixed with context (full url relative to server root)
    • setRootUrl

      public void setRootUrl(String rootUrl)
    • getRequiredRenderers

      public List<String> getRequiredRenderers()
      Returns:
      list of required renderers or empty list
    • setRequiredRenderers

      public void setRequiredRenderers(List<String> requiredRenderers)
    • getMainAssetsLocation

      public String getMainAssetsLocation()
      Never starts with slash and always ends with slash.
      Returns:
      main assets classpath location
    • setMainAssetsLocation

      public void setMainAssetsLocation(String mainAssetsLocation)
    • getAssets

      public com.google.common.collect.Multimap<String,String> getAssets()
      Returned assets are sorted for resolution: registration order of packages is preserved in order to be able to override resources from previous registrations. In returned model registration order is reversed, so the latest registered package will be the first (simply to check it first - correctly handle overrides).

      Contexts never starts with slash, but always ends (for proper matching). Root context is empty string. Classpath locations never starts with slash and always ends with slash.

      Returns:
      all application asset mappings (including extensions)
    • setAssets

      public void setAssets(com.google.common.collect.Multimap<String,String> assets)
    • getViews

      public Map<String,String> getViews()
      When root mapping is not explicitly declared, its set to application name (so map will never be empty).

      Contexts never starts with slash, but always ends (for proper matching). Root context is empty string. Rest prefixes never starts with slash and always ends with slash (for proper matching).

      Returns:
      all application view mappings (including extensions)
    • setViews

      public void setViews(Map<String,String> views)
    • getMainRestPrefix

      public String getMainRestPrefix()
      Returns:
      main rest mapping prefix
    • getAssetExtensions

      public com.google.common.collect.Multimap<String,String> getAssetExtensions()
      Returns:
      only extension asset declarations or empty map
    • setAssetExtensions

      public void setAssetExtensions(com.google.common.collect.Multimap<String,String> assetExtensions)
    • getViewExtensions

      public Map<String,String> getViewExtensions()
      Returns:
      only extension view rest mappings or empty map
    • setViewExtensions

      public void setViewExtensions(Map<String,String> viewExtensions)
    • getRestRootUrl

      public String getRestRootUrl()
      May be used to construct full rest urls (relative to server root).
      Returns:
      rest context mapping url or null when jetty not yet started
    • setRestRootUrl

      public void setRestRootUrl(String restRootUrl)
    • getIndexFile

      public String getIndexFile()
      Returns:
      configured index file (empty string by default, meaning index.html)
    • setIndexFile

      public void setIndexFile(String indexFile)
    • getFilesRegex

      public String getFilesRegex()
      Returns:
      asset (static resources) calls detection regexp
    • setFilesRegex

      public void setFilesRegex(String filesRegex)
    • isHasDefaultFilesRegex

      public boolean isHasDefaultFilesRegex()
      Returns:
      true when default assets detection regexp used, false otherwise
    • setHasDefaultFilesRegex

      public void setHasDefaultFilesRegex(boolean hasDefaultFilesRegex)
    • isSpa

      public boolean isSpa()
      Returns:
      true when spa routing enabled (serve index page for all requested paths, except assets), false when disabled (default)
    • setSpa

      public void setSpa(boolean spa)
    • getSpaRegex

      public String getSpaRegex()
      Returns:
      non spa route path recognition regexp
    • setSpaRegex

      public void setSpaRegex(String spaRegex)
    • isHasDefaultSpaRegex

      public boolean isHasDefaultSpaRegex()
      Returns:
      true when defaul regexp used, false otherwise
    • setHasDefaultSpaRegex

      public void setHasDefaultSpaRegex(boolean hasDefaultSpaRegex)
    • getErrorPages

      public Map<Integer,String> getErrorPages()
      Default error page has -1 code.
      Returns:
      configured error pages (mapping by code) or empty map if nothing configured
    • setErrorPages

      public void setErrorPages(Map<Integer,String> errorPages)
    • getDefaultErrorPage

      public String getDefaultErrorPage()
      Returns:
      default error page (for all non mapped error codes) or null if not declared
    • getViewPaths

      public List<MappedViewPath> getViewPaths()
      Returns:
      mapped view rest methods
    • setViewPaths

      public void setViewPaths(List<MappedViewPath> viewPaths)
    • getHiddenViewPaths

      public List<HiddenViewPath> getHiddenViewPaths()
      Hidden methods appear when sub url mapped to different rest prefix, making all root rest paths under the same prefix unreachable.
      Returns:
      hidden view rest method
    • setHiddenViewPaths

      public void setHiddenViewPaths(List<HiddenViewPath> hiddenViewPaths)