Package helma.framework.core

# Class Skin

java.lang.Object
helma.framework.core.Skin

public final class Skin extends Object
This represents a Helma skin, i.e. a template created from containing Macro tags that will be dynamically evaluated.. It uses the request path array from the RequestEvaluator object to resolve Macro handlers by type name.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`class`
`Skin.Macro`

## Constructor Summary

Constructors
Constructor
Description
`Skin(char[] content, int length, Application app)`
Create a skin without any restrictions on the macros from a char array.
`Skin(String content, Application app)`
Create a skin without any restrictions on which macros are allowed to be called from it
`Skin(String content, Application app, HashSet sandbox)`
Create a skin with a sandbox which contains the names of macros allowed to be called

## Method Summary

Modifier and Type
Method
Description
`void`
`allowMacro(String macroname)`
Adds a macro to the list of allowed macros.
`boolean`
`containsMacro(String macroname)`
Check if a certain macro is present in this skin.
`String`
`getExtends()`
`Skin.Macro[]`
`getMacros()`
Return the list of macros found by the parser
`static Skin`
`getSkin(Resource res, Application app)`
`String`
`getSource()`
Get the raw source text this skin was parsed from
`Skin`
`getSubskin(String name)`
Get a subskin by name
`String[]`
`getSubskinNames()`
Return an array of subskin names defined in this skin
`boolean`
`hasMainskin()`
Check if this skin has a main skin, as opposed to consisting just of subskins
`boolean`
`hasSubskin(String name)`
Check if this skin contains a subskin with the given name
`void`
`render(RequestEvaluator reval, Object thisObject, Object paramObject)`
Render this skin
`String`
`renderAsString(RequestEvaluator reval, Object thisObject, Object paramObject)`
Render this skin and return it as string

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

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

## Constructor Details

### Skin

public Skin(String content, Application app)
Create a skin without any restrictions on which macros are allowed to be called from it

### Skin

public Skin(String content, Application app, HashSet sandbox)
Create a skin with a sandbox which contains the names of macros allowed to be called

### Skin

public Skin(char[] content, int length, Application app)
Create a skin without any restrictions on the macros from a char array.

## Method Details

### getSkin

public static Skin getSkin(Resource res, Application app) throws IOException

Throws:
  `IOException`

### getMacros

public Skin.Macro[] getMacros()
Return the list of macros found by the parser

Returns:
  the list of macros

### hasMainskin

public boolean hasMainskin()
Check if this skin has a main skin, as opposed to consisting just of subskins

Returns:
  true if this skin contains a main skin

### hasSubskin

public boolean hasSubskin(String name)
Check if this skin contains a subskin with the given name

Parameters:
  `name` - a subskin name
Returns:
  true if the given subskin exists

### getSubskin

public Skin getSubskin(String name)
Get a subskin by name

Parameters:
  `name` - the subskin name
Returns:
  the subskin

### getSubskinNames

public String[] getSubskinNames()
Return an array of subskin names defined in this skin

Returns:
  a string array containing this skin's substrings

### getExtends

public String getExtends()

### getSource

public String getSource()
Get the raw source text this skin was parsed from

### renderAsString

public String renderAsString(RequestEvaluator reval, Object thisObject, Object paramObject) throws RedirectException, UnsupportedEncodingException
Render this skin and return it as string

Throws:
  `RedirectException`
  `UnsupportedEncodingException`

### render

public void render(RequestEvaluator reval, Object thisObject, Object paramObject) throws RedirectException, UnsupportedEncodingException
Render this skin

Throws:
  `RedirectException`
  `UnsupportedEncodingException`

### containsMacro

public boolean containsMacro(String macroname)
Check if a certain macro is present in this skin. The macro name is in handler.name notation

### allowMacro

public void allowMacro(String macroname)
Adds a macro to the list of allowed macros. The macro is in handler.name notation.