Class AbstractSkinParameter
- java.lang.Object
-
- org.ametys.skinfactory.parameters.AbstractSkinParameter
-
- Direct Known Subclasses:
CSSParameter
,I18nizableTextParameter
,ImageParameter
,TextParameter
,VariantParameter
public abstract class AbstractSkinParameter extends Object
Class representing a parameter of a skin.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractSkinParameter.SkinParameterType
Enumeration of supported typesclass
AbstractSkinParameter.Widget
Widget class
-
Constructor Summary
Constructors Constructor Description AbstractSkinParameter(String id, I18nizableText label, I18nizableText description)
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
apply(Path tempDir, Path modelDir, Object value, String lang)
Apply parameter to the skinabstract Object
getDefaultValue(SkinModel model)
Get the default valueabstract Object
getDefaultValue(SkinModel model, String lang)
Get the default valueI18nizableText
getDescription()
Get the descriptionString
getId()
Get the unique idI18nizableText
getLabel()
Get the labelabstract AbstractSkinParameter.SkinParameterType
getType()
Get typevoid
setDescription(I18nizableText description)
Set the descriptionvoid
setLabel(I18nizableText label)
Set the labelabstract Map<String,Object>
toJson(String modelName)
Transform the parameter into a JSON objectabstract void
toSAX(ContentHandler contentHandler, String modelName)
SAX the parameter
-
-
-
Constructor Detail
-
AbstractSkinParameter
public AbstractSkinParameter(String id, I18nizableText label, I18nizableText description)
Constructor- Parameters:
id
- the unique idlabel
- the labeldescription
- the description
-
-
Method Detail
-
getLabel
public I18nizableText getLabel()
Get the label- Returns:
- the label
-
setLabel
public void setLabel(I18nizableText label)
Set the label- Parameters:
label
- the label to set
-
getDescription
public I18nizableText getDescription()
Get the description- Returns:
- the description
-
setDescription
public void setDescription(I18nizableText description)
Set the description- Parameters:
description
- the description to set
-
getType
public abstract AbstractSkinParameter.SkinParameterType getType()
Get type- Returns:
- The type
-
apply
public abstract void apply(Path tempDir, Path modelDir, Object value, String lang)
Apply parameter to the skin- Parameters:
tempDir
- the work directorymodelDir
- the model directoryvalue
- the valuelang
- The language. Can be null.
-
toSAX
public abstract void toSAX(ContentHandler contentHandler, String modelName) throws SAXException
SAX the parameter- Parameters:
contentHandler
- The content handler to SAX intomodelName
- The model name- Throws:
SAXException
- if an error occurred while SAXing
-
toJson
public abstract Map<String,Object> toJson(String modelName)
Transform the parameter into a JSON object- Parameters:
modelName
- The model name- Returns:
- The JSON representation of the parameter
-
getDefaultValue
public abstract Object getDefaultValue(SkinModel model)
Get the default value- Parameters:
model
- The model- Returns:
- The default value
-
getDefaultValue
public abstract Object getDefaultValue(SkinModel model, String lang)
Get the default value- Parameters:
model
- The modellang
- The language- Returns:
- The default value
-
-