Package ca.phon.script.params
Class ScriptParameters
- All Implemented Interfaces:
Visitable<ScriptParam>
,Serializable
,Cloneable
,Iterable<ScriptParam>
,Collection<ScriptParam>
,List<ScriptParam>
,RandomAccess
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(Visitor<ScriptParam> visitor) Accept the given visitor.void
copyParams
(ScriptParameters newParams) Copy param values from the given script parametersstatic void
copyParams
(ScriptParameters oldParams, ScriptParameters newParams) Copies any values from oldParams which have matching ids in newParams.static String
extractParamsComment
(String text) Extract the first params comment section found in the given script text.Get the set of paramIdsgetParamValue
(String paramId) Get value of given paramIdvoid
loadFromMap
(Map<String, Object> paramMap) static ScriptParameters
parseScriptParams
(String text) Extract script parameters from the comments of the given text.setParamValue
(String paramId, Object val) Set the value of the specified paramIdtoHTMLString
(boolean modifiedOnly) toHTMLString
(boolean modifiedOnly, List<String> includes, List<String> excludes) Return an HTML formatted version of the script parameters.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
Constructor Details
-
ScriptParameters
public ScriptParameters()
-
-
Method Details
-
extractParamsComment
Extract the first params comment section found in the given script text.- Parameters:
script
-- Returns:
- parameters section if found,
null
if not found
-
parseScriptParams
Extract script parameters from the comments of the given text. The text must match the syntax defined by the ScriptParams.g ANTLR grammar.- Parameters:
text
-- Returns:
- the list of script parameters defined within the script comments
-
copyParams
Copies any values from oldParams which have matching ids in newParams.- Parameters:
oldParams
-newParams
-
-
copyParams
Copy param values from the given script parameters- Parameters:
params
-
-
setParamValue
Set the value of the specified paramId- Parameters:
paramId
-value
-- Returns:
- old value of the specified paramId
-
getParamValue
Get value of given paramId- Parameters:
paramId
-- Returns:
- value of paramId
-
getParamIds
Get the set of paramIds- Returns:
- set of paramIds
-
loadFromMap
-
getHashString
-
toHTMLString
-
toHTMLString
-
toHTMLString
Return an HTML formatted version of the script parameters.- Parameters:
modifiedOnly
-includes
-excludes
-- Returns:
-
accept
Description copied from interface:Visitable
Accept the given visitor.- Specified by:
accept
in interfaceVisitable<ScriptParam>
-