org.apache.turbine.modules

## Class Screen

- java.lang.Object
- - org.apache.turbine.modules.Assembler
  - - org.apache.turbine.modules.Screen

- Direct Known Subclasses:
    InvalidState, RawScreen, TemplateScreen

      public abstract class Screen
      extends Assembler

  This is the base class which defines the Screen modules.
  Version:
    $Id: Screen.java 1773378 2016-12-09 13:19:59Z tv $
  Author:
    Dave Bryson, Henning P. Schmiedehausen, Peter Courcoux

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `CACHE_SIZE_DEFAULT` The default size for the screen cache
    `static String` | `CACHE_SIZE_KEY` Property for the size of the screen cache if caching is on
    `static String` | `NAME` Represents Screen Objects
    `static String` | `PREFIX` Prefix for screen related classes and templates

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Screen()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected String` | `build(PipelineData pipelineData)` Subclasses can override this method to add additional functionality.
    `protected abstract String` | `doBuild(PipelineData pipelineData)` A subclass must override this method to build itself.
    `String` | `getLayout(PipelineData pipelineData)` If the Layout has not been defined by the Screen then set the layout to be "DefaultLayout".
    `String` | `getPrefix()` Abstract method to provide the prefix for module related classes and templates
    `void` | `setLayout(PipelineData pipelineData, String layout)` Set the layout for a Screen.

    - ### Methods inherited from class org.apache.turbine.modules.Assembler

      `getRunData`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PREFIX

          public static final String PREFIX

      Prefix for screen related classes and templates
      See Also:
        Constant Field Values

    - #### CACHE_SIZE_KEY

          public static final String CACHE_SIZE_KEY

      Property for the size of the screen cache if caching is on
      See Also:
        Constant Field Values

    - #### CACHE_SIZE_DEFAULT

          public static final int CACHE_SIZE_DEFAULT

      The default size for the screen cache
      See Also:
        Constant Field Values

    - #### NAME

          public static final String NAME

      Represents Screen Objects
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Screen

          public Screen()

  - ### Method Detail

    - #### getPrefix

          public String getPrefix()

      Description copied from class: `Assembler`
      Abstract method to provide the prefix for module related classes and templates
      Specified by:
        `getPrefix` in class `Assembler`
      Returns:
        the prefix
      See Also:
        `Assembler.getPrefix()`

    - #### doBuild

          protected abstract String doBuild(PipelineData pipelineData)
                                     throws Exception

      A subclass must override this method to build itself. Subclasses override this method to store the screen in RunData or to write the screen to the output stream referenced in RunData.
      Parameters:
        `pipelineData` - Turbine information.
      Returns:
        the content of the screen
      Throws:
        `Exception` - a generic exception.

    - #### build

          protected String build(PipelineData pipelineData)
                          throws Exception

      Subclasses can override this method to add additional functionality. This method is protected to force clients to use ScreenLoader to build a Screen.
      Parameters:
        `pipelineData` - Turbine information.
      Returns:
        the content of the screen
      Throws:
        `Exception` - a generic exception.

    - #### getLayout

          public String getLayout(PipelineData pipelineData)

      If the Layout has not been defined by the Screen then set the layout to be "DefaultLayout". The Screen object can also override this method to provide intelligent determination of the Layout to execute. You can also define that logic here as well if you want it to apply on a global scale. For example, if you wanted to allow someone to define Layout "preferences" where they could dynamically change the Layout for the entire site. The information for the request is passed in with the PipelineData object.
      Parameters:
        `pipelineData` - Turbine information.
      Returns:
        A String with the Layout.

    - #### setLayout

          public void setLayout(PipelineData pipelineData,
                       String layout)

      Set the layout for a Screen.
      Parameters:
        `pipelineData` - Turbine information.
        `layout` - The layout name.

Copyright © 2000–2018 The Apache Software Foundation. All rights reserved.