public class PluginInclude extends AbstractPlugin
Example:
Perform plugin as in login.html.
The CSS annotated version:
Perform plugin as in <a href="#" class="include">login.html</a>.
| Modifier and Type | Field and Description |
|---|---|
static String |
CSS_INCLUDED
Style added to included file.
|
static String |
CSS_INCLUDED_ARGS
Style added to args.
|
static String |
CSS_INCLUDED_CONTENT
Style added to content file.
|
static String |
CSS_INCLUDED_FILE
Style added to the header file.
|
static Integer |
DEFAULT_DEPTH
Default value.
|
static Boolean |
DEFAULT_EXPANDED
Default include expanded state.
|
static Boolean |
DEFAULT_INJECTED
Default injected state.
|
protected Integer |
depth
Max depth of inclusion.
|
protected String |
dir
Input directory file.
|
protected Boolean |
expanded
Expanded state.
|
static String |
FEATURE_DEPTH
Max deep of includes.
|
static String |
FEATURE_EXPANDED
Enable expanded mode for features.
|
static String |
FEATURE_INJECTED
Injected included files feature.
|
static String |
FEATURE_RESOLVER
Resolver of URIs.
|
static String |
FEATURE_TRANSFORMER
Transformer type as feature.
|
protected String |
href
Link to file.
|
protected Boolean |
injected
Injected state.
|
protected IResolver |
resolver
Relative URI resolver.
|
protected String |
transformer
Transformer to be used after loading in addiction to the general
transformer.
|
FEATURE_CONDITION, FEATURE_NORMALIZED, FEATURE_NORMALIZER, FEATURE_SLEEP, FEATURE_THREADSAFE, FEATURE_TIMEOUT, FEATURE_WAITparameters| Constructor and Description |
|---|
PluginInclude() |
| Modifier and Type | Method and Description |
|---|---|
protected nu.xom.Node |
bindParameters(IContext context)
Normalize path removing parameters which are set as arguments.
|
ENext |
doStart(IContext context,
IResultSet result)
Performs the start action.
|
ActionType |
getActionType()
Get the plugin type.
|
Integer |
getDepth()
The max depth allowed for inclusion files.
|
String |
getDir()
The input directory.
|
protected nu.xom.Document |
getDocument(ISource newSource)
Get document from source.
|
Boolean |
getExpanded()
Gets the status expected for inclusion.
|
String |
getHref()
The link reference.
|
Boolean |
getInjected()
Get the injected information.
|
protected String |
getPath(IContext context)
Normalize path removing parameters.
|
IResolver |
getResolver()
Resolver of relative links.
|
protected ISource |
getSource(URI newHref)
Get source from a URI.
|
String |
getTransformer()
Get the transformer field.
|
void |
initialize(IContext context)
Initialize the plugin.
|
protected String |
prepareTargetLink(ISource newSource)
Get original resource link relative to current output.
|
void |
setDepth(Integer depth)
Set max depth.
|
void |
setDir(String dir)
Output directory file.
|
void |
setExpanded(Boolean expanded)
Set expanded mode.
|
void |
setHref(String href)
Set link reference.
|
void |
setInjected(Boolean injected)
Set injected state.
|
void |
setResolver(IResolver resolver)
Change the resolver.
|
void |
setTransformer(String transformer)
Set the transformer.
|
protected StringBuilder |
toString(IContext context)
Cycle as string.
|
protected ISource |
transform(ISource newSource)
Perform source transformation.
|
copy, doEnd, getCondition, getConditionModel, getNormalized, getNormalized, getNormalizer, getParent, getSleep, getSleepModel, getThreadsafe, getTimeout, getTimeoutModel, getWait, getWaitModel, setCondition, setConditionModel, setNormalized, setNormalizer, setParent, setSleep, setSleepModel, setThreadsafe, setTimeout, setTimeoutModel, setWait, setWaitModel, toStringgetParameters, setParametersclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetParameters, setParameterspublic static final String CSS_INCLUDED
public static final String CSS_INCLUDED_FILE
public static final String CSS_INCLUDED_ARGS
public static final String CSS_INCLUDED_CONTENT
protected String dir
protected String href
public static final String FEATURE_DEPTH
public static final Integer DEFAULT_DEPTH
protected Integer depth
public static final String FEATURE_INJECTED
public static final Boolean DEFAULT_INJECTED
protected Boolean injected
public static final String FEATURE_EXPANDED
public static final Boolean DEFAULT_EXPANDED
protected Boolean expanded
public static final String FEATURE_TRANSFORMER
protected String transformer
public static final String FEATURE_RESOLVER
protected IResolver resolver
public String getDir()
public void setDir(String dir)
dir - The directory.public String getHref()
public void setHref(String href)
href - The reference.public Integer getDepth()
public void setDepth(Integer depth)
depth - The depth.public Boolean getInjected()
public void setInjected(Boolean injected)
injected - true, to inject HTML, false, otherwise.public Boolean getExpanded()
public void setExpanded(Boolean expanded)
expanded - The expanded value.public String getTransformer()
public void setTransformer(String transformer)
transformer - The transformer.public IResolver getResolver()
public void setResolver(IResolver resolver)
resolver - A resolver.public ActionType getActionType()
IActionTypepublic void initialize(IContext context) throws PluginException
IPlugininitialize in interface IPlugininitialize in class AbstractPlugincontext - The test context.PluginException - On initialization errors.public ENext doStart(IContext context, IResultSet result) throws PluginException
IPlugindoStart in interface IPlugindoStart in class AbstractPlugincontext - The context.result - The result set.PluginException - On execution errors.protected ISource getSource(URI newHref) throws PluginException
newHref - The URI.PluginException - On reading errors.protected nu.xom.Document getDocument(ISource newSource) throws PluginException
newSource - The source.PluginException - On load errors.protected ISource transform(ISource newSource) throws PluginException
newSource - Source to be transformed.PluginException - On transform errors.protected nu.xom.Node bindParameters(IContext context) throws PluginException
context - The context.PluginException - On plugin errors.protected String getPath(IContext context) throws PluginException
context - The context.PluginException - On plugin errors.protected StringBuilder toString(IContext context)
context - The context.Copyright © 2016. All rights reserved.