Package net.sf.gridarta.plugin.parameter
Class MapPathParameter<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.plugin.parameter.AbstractPluginParameter<G,A,R,V>
-
- net.sf.gridarta.plugin.parameter.AbstractStringPluginParameter<G,A,R,java.lang.String>
-
- net.sf.gridarta.plugin.parameter.MapPathParameter<G,A,R>
-
- All Implemented Interfaces:
PluginParameter<G,A,R,java.lang.String>
public class MapPathParameter<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends AbstractStringPluginParameter<G,A,R,java.lang.String>
APluginParameterthat holds a path with in the maps directory.
-
-
Field Summary
Fields Modifier and Type Field Description static @NotNull java.lang.StringPARAMETER_TYPEThe string representation of this parameter type.
-
Constructor Summary
Constructors Constructor Description MapPathParameter(@NotNull PathManager pathManager, @NotNull ProjectSettings projectSettings)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull java.lang.StringgetParameterType()Returns the parameter type name.@NotNull java.lang.StringgetValue()Returns the current value of this parameter.@Nullable java.lang.StringgetValueOrNull()Returns the current value of this parameter.voidsetFile(@NotNull java.io.File file)Sets the value from aFileinstance.<T> Tvisit(@NotNull PluginParameterVisitor<G,A,R,T> visitor)Calls thevisit()function for this parameter type.-
Methods inherited from class net.sf.gridarta.plugin.parameter.AbstractStringPluginParameter
getStringValue, setStringValue
-
Methods inherited from class net.sf.gridarta.plugin.parameter.AbstractPluginParameter
addPluginParameterListener, changed, getDescription, getName, removePluginParameterListener, setDescription, setName
-
-
-
-
Field Detail
-
PARAMETER_TYPE
@NotNull public static final @NotNull java.lang.String PARAMETER_TYPE
The string representation of this parameter type.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MapPathParameter
public MapPathParameter(@NotNull @NotNull PathManager pathManager, @NotNull @NotNull ProjectSettings projectSettings)Creates a new instance.- Parameters:
pathManager- the path manager instance for converting files into path namesprojectSettings- the project settings instance
-
-
Method Detail
-
getParameterType
@NotNull public @NotNull java.lang.String getParameterType()
Description copied from interface:PluginParameterReturns the parameter type name.- Returns:
- the parameter type name
-
visit
@NotNull public <T> T visit(@NotNull @NotNull PluginParameterVisitor<G,A,R,T> visitor)Description copied from interface:PluginParameterCalls thevisit()function for this parameter type.- Type Parameters:
T- the visitor-specific type of the return value- Parameters:
visitor- the visitor to call- Returns:
- a visitor-specific return value
-
getValue
@NotNull public @NotNull java.lang.String getValue()
Description copied from interface:PluginParameterReturns the current value of this parameter.- Returns:
- the value
-
getValueOrNull
@Nullable public @Nullable java.lang.String getValueOrNull()
Description copied from interface:PluginParameterReturns the current value of this parameter.- Returns:
- the value or
nullif the the value is invalid
-
setFile
public void setFile(@NotNull @NotNull java.io.File file) throws InvalidValueExceptionSets the value from aFileinstance.- Parameters:
file- the file instance- Throws:
InvalidValueException- if the file instance is invalid
-
-