net.sf.xslthl
Class Params

java.lang.Object
  extended by net.sf.xslthl.Params

public class Params
extends Object

Syntax highlighter parameters


Nested Class Summary
static interface Params.ParamsLoader<T>
           
 
Field Summary
protected  Element paramElem
           
 
Constructor Summary
Params(Element paramElem)
           
 
Method Summary
<T> void
getMultiParams(String name, Collection<T> list, Params.ParamsLoader<? extends T> loader)
          Get the parameters using a specialized loader
 void getMutliParams(String name, Collection<String> list)
          Load multiple parameters into a list
 String getParam()
          Get the current element as value
 String getParam(String name)
          Get a single parameter.
 String getParam(String name, String defaultValue)
          Get a single parameter with a default value.
 Params getParams(String name)
           
protected  String getTextContent(Node elm)
          Return the text content for the given element.
 boolean isSet(String name)
          Return true if a parameter with the given name exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

paramElem

protected Element paramElem
Constructor Detail

Params

public Params(Element paramElem)
Method Detail

getTextContent

protected String getTextContent(Node elm)
Return the text content for the given element. This is different from the Element.getTextContect() function in a way that normal text nodes are trimmed and CDATA is used AS IS

Parameters:
elm -
Returns:

getParam

public String getParam()
Get the current element as value

Returns:

getParam

public String getParam(String name)
Get a single parameter. Returns null when the parameter doesn't exist.

Parameters:
name -
Returns:

getParam

public String getParam(String name,
                       String defaultValue)
Get a single parameter with a default value.

Parameters:
name -
defaultValue -
Returns:

getParams

public Params getParams(String name)
Parameters:
name -
Returns:

isSet

public boolean isSet(String name)
Return true if a parameter with the given name exists.

Parameters:
name -
Returns:

getMutliParams

public void getMutliParams(String name,
                           Collection<String> list)
Load multiple parameters into a list

Parameters:
name -
list -

getMultiParams

public <T> void getMultiParams(String name,
                               Collection<T> list,
                               Params.ParamsLoader<? extends T> loader)
                    throws HighlighterConfigurationException
Get the parameters using a specialized loader

Type Parameters:
T -
Parameters:
name -
list -
loader -
Throws:
HighlighterConfigurationException


Copyright © 2005-2014. All Rights Reserved.