|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tinyjee.maven.dim.sources.AbstractSnippetSelector
public abstract class AbstractSnippetSelector
Implements an abstract base for snippet selectors that operate on a single expression prefix.
| Field Summary | |
|---|---|
protected String |
expressionPrefix
The prefix to use for detecting expressions belonging to this selector. |
| Fields inherited from interface org.tinyjee.maven.dim.spi.SnippetSelector |
|---|
CASE_SENSITIVE, EXPAND_SNIPPETS, SELECTORS |
| Constructor Summary | |
|---|---|
protected |
AbstractSnippetSelector(String expressionPrefix)
Constructs a new instance with the given expression-prefix. |
| Method Summary | |
|---|---|
protected void |
assertExpressionIsValid(String expression,
URL contentUrl,
Map<String,Object> macroParameters)
Fails if the given expression cannot be used to select snippets. |
boolean |
canSelectSnippetsWith(String expression,
URL contentUrl,
Map<String,Object> macroParameters)
Returns true if the expression is supported by this snippet selector. |
String[] |
getExpressionPrefixes()
Returns all prefixes that are explicitly supported by this snippet selector. |
protected String |
stripPrefix(String expression)
Strips the prefix form the given snippet selection expression. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.tinyjee.maven.dim.spi.SnippetSelector |
|---|
selectSnippets |
| Field Detail |
|---|
protected final String expressionPrefix
| Constructor Detail |
|---|
protected AbstractSnippetSelector(String expressionPrefix)
expressionPrefix - the prefix to use for detecting expressions belonging to this selector.| Method Detail |
|---|
public String[] getExpressionPrefixes()
SnippetSelector
getExpressionPrefixes in interface SnippetSelector
public boolean canSelectSnippetsWith(String expression,
URL contentUrl,
Map<String,Object> macroParameters)
SnippetSelector
canSelectSnippetsWith in interface SnippetSelectorexpression - a single snippet expression.contentUrl - the resolved URL of the content to include (might be 'null' if the source does not provide a Url).macroParameters - the parameters used with the macro call.
protected void assertExpressionIsValid(String expression,
URL contentUrl,
Map<String,Object> macroParameters)
expression - the expression to test.contentUrl - the url to the content.macroParameters - the parameters given with the macro call.protected String stripPrefix(String expression)
expression - the expression to process.
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||