public interface ISkinConfig
Modifier and Type | Method and Description |
---|---|
<T> T |
eval(String vtl,
Class<T> requiredClass)
Evaluate a velocity expression in the current context.
|
org.codehaus.plexus.util.xml.Xpp3Dom |
get(String property)
Default accessor for config properties.
|
<T> T |
getAttributeValue(String property,
String attribute,
Class<T> targetType,
T defaultValue)
Gets the attribute value of the given
attribute of property . |
<T> T |
getAttributeValue(org.codehaus.plexus.util.xml.Xpp3Dom element,
String attribute,
Class<T> targetType,
T defaultValue)
Get the value contained in specific attribute of
element parameter. |
Context<?> |
getContext() |
<T> T |
getContextValue(String key,
Class<T> type)
Gets the associated value to
key stored in Velocity context. |
String |
getFileId() |
org.codehaus.plexus.util.xml.Xpp3Dom |
getGlobalProperties() |
String |
getNamespace() |
org.codehaus.plexus.util.xml.Xpp3Dom |
getPageProperties() |
org.apache.maven.project.MavenProject |
getProject() |
Object |
getProjectId() |
<T> T |
getPropertyValue(String property,
Class<T> targetType,
T defaultValue)
Gets the text value of the given
property . |
String |
getResourcePath() |
org.apache.maven.doxia.site.SiteModel |
getSiteModel() |
<T> T |
getToolbox(String toolName,
Class<T> toolType)
Gets the associated tool to
name stored in toolbox of Velocity context. |
boolean |
isActiveLink(String href)
Gets the indicating if the link is active.
|
boolean |
not(String property)
A convenience method to check if the value of the
property is "false" . |
String |
relativeLink(String href) |
void |
setContextValue(String key,
Object value)
Sets the value in Velocity context associated to
key . |
boolean not(String property)
property
is "false"
. Useful for properties that
are enabled by default - checks if the property is set to "false"
explicitly.property
- the property of interesttrue
if the configuration value is set either in page or globally, and is equal to
"false"
. Note that this will return false
if property is not set at all.get(String)
<T> T getContextValue(@Nonnull String key, @Nonnull Class<T> type)
key
stored in Velocity context.T
- the type of expected value.key
- the key name of associated value in Velocity context.type
- the the type of expected value.key
stored in Velocity context.void setContextValue(@Nonnull String key, Object value)
key
.key
- the key name of associated value in Velocity context.value
- the new value@Nullable <T> T getToolbox(@Nonnull String toolName, @Nonnull Class<T> toolType)
name
stored in toolbox of Velocity context.T
- the type of expected tool.toolName
- the name of tool associated in Velocity context.toolType
- the expected class of tool.name
stored in toolbox of Velocity context.@Nonnull org.codehaus.plexus.util.xml.Xpp3Dom getGlobalProperties()
Xpp3Dom
.@Nonnull org.codehaus.plexus.util.xml.Xpp3Dom getPageProperties()
Xpp3Dom
.@Nullable Object getProjectId()
String
representing the projectId.@Nonnull org.apache.maven.project.MavenProject getProject()
@Nonnull org.apache.maven.doxia.site.SiteModel getSiteModel()
@Nullable org.codehaus.plexus.util.xml.Xpp3Dom get(@Nonnull String property)
$config.get("myproperty")
, one can utilise
Velocity fallback onto the default getter and use $config.myproperty
.property
- the property of interestnull
otherwise@Nullable <T> T getPropertyValue(@Nonnull String property, @Nonnull Class<T> targetType, @Nullable T defaultValue)
property
.T
- the type of returned object.property
- the property to usetargetType
- the returned target type use to convert value.defaultValue
- the default value used if property doesn't exist.property
.@Nullable <T> T getAttributeValue(@Nonnull String property, @Nonnull String attribute, @Nonnull Class<T> targetType, @Nullable T defaultValue)
attribute
of property
.T
- the type of returned object.property
- the property to useattribute
- the attribute to use.targetType
- the returned target type use to convert value.defaultValue
- the default value used if property doesn't exist.property
.@Nullable <T> T getAttributeValue(@Nonnull org.codehaus.plexus.util.xml.Xpp3Dom element, @Nonnull String attribute, @Nonnull Class<T> targetType, T defaultValue)
element
parameter.T
- the type of returned value.element
- the xml element.attribute
- the attribute name.targetType
- the class of converted returned value.defaultValue
- the value to return if attribute is empty or null
.element
parameter if exists, otherwise
returns the default value.@Nullable String relativeLink(String href)
href
- link to relative.boolean isActiveLink(@Nullable String href)
href
- the link to check.true
the link is active, otherwise false
.@Nullable <T> T eval(@Nullable String vtl, @Nonnull Class<T> requiredClass)
T
- Tthe type of expected returned value.vtl
- The velocity expression to evaluaterequiredClass
- the class of returned value.Copyright © 2012–2023 Friederich Christophe. All rights reserved.