Class SerializedRequestAttrVar

java.lang.Object
org.apache.juneau.svl.Var
org.apache.juneau.svl.StreamedVar
org.apache.juneau.rest.vars.SerializedRequestAttrVar

Serialized request attribute variable resolver.

The format for this var is "$SA{contentType,key[,defaultValue]}".

This variable resolver requires that a RestRequest bean be available in the session bean store.

Since this is a SimpleVar, any variables contained in the result will be recursively resolved. Likewise, if the arguments contain any variables, those will be resolved before they are passed to this var.

See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • resolveTo

      public void resolveTo(VarResolverSession session, Writer w, String key) throws Exception
      Description copied from class: Var
      The interface that needs to be implemented for subclasses of StreamedVar.
      Specified by:
      resolveTo in class Var
      Parameters:
      session - The session object used for a single instance of a var resolution.
      w - The writer to send the resolved value to.
      key - The inside argument of the variable.
      Throws:
      Exception - Any exception can be thrown.
    • allowNested

      protected boolean allowNested()
      Description copied from class: Var
      Returns whether nested variables are supported by this variable.

      For example, in "$X{$Y{xxx}}", $Y is a nested variable that will be resolved if this method returns true.

      The default implementation of this method always returns true. Subclasses can override this method to override the default behavior.

      Overrides:
      allowNested in class Var
      Returns:
      true if nested variables are supported by this variable.
    • allowRecurse

      protected boolean allowRecurse()
      Description copied from class: Var
      Returns whether variables in the resolved contents of this variable should also be resolved.

      For example, if "$X{xxx}" resolves to "$Y{xxx}", then the $Y variable will be recursively resolved if this method returns true.

      The default implementation of this method always returns true.
      Subclasses can override this method to override the default behavior.

      As a general rule, variables that resolve user-entered data should not be recursively resolved as this may cause a security hole.
      Overrides:
      allowRecurse in class Var
      Returns:
      true if resolved variables should be recursively resolved.
    • canResolve

      public boolean canResolve(VarResolverSession session)
      Description copied from class: Var
      Returns true if this variable can be resolved in the specified session.

      For example, some variable cannot resolve unless specific context or session objects are available.

      Overrides:
      canResolve in class Var
      Parameters:
      session - The current session.
      Returns:
      true if this variable can be resolved in the specified session.