public class Argument extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Argument.Kind |
static class |
Argument.Output |
Constructor and Description |
---|
Argument(Node argumentNode)
Create option instance from option node.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Boolean value)
Add to the list of values the provided Boolean value.
|
void |
add(Double value)
Add to the list of values the provided Double value.
|
void |
add(File file,
JobStorage context)
Add to the list of values the provided File value.
|
void |
add(Integer value)
Add to the list of values the provided Integer value.
|
void |
add(Long value)
Add to the list of values the provided Long value.
|
void |
add(String value)
Add to the list of values the provided String value.
|
void |
addAll(Collection<String> values)
Add to the list of values all the provided String values.
|
void |
clear()
Clear the given option or input.
|
String |
get()
Get the value as a String.
|
Boolean |
getAsBoolean()
Get the value as a Boolean.
|
Double |
getAsDouble()
Get the value as a Double.
|
File |
getAsFile(JobStorage context)
Get the value as a File.
|
List<File> |
getAsFileList(JobStorage context)
Get all the values as a List of Files.
|
Integer |
getAsInteger()
Get the value as a Integer.
|
List<String> |
getAsList()
Get all the values as a List of Strings.
|
Long |
getAsLong()
Get the value as a Long.
|
String |
getDefaultValue()
Get the default value as a String.
|
Boolean |
getDefaultValueAsBoolean()
Get the default value as a Boolean.
|
Double |
getDefaultValueAsDouble()
Get the default value as a Double.
|
File |
getDefaultValueAsFile(JobStorage context)
Get the default value as a File.
|
Integer |
getDefaultValueAsInteger()
Get the default value as a Integer.
|
Long |
getDefaultValueAsLong()
Get the default value as a Long.
|
String |
getDesc() |
Argument.Kind |
getKind() |
List<String> |
getMediaTypes() |
String |
getName() |
String |
getNicename() |
Boolean |
getOrdered() |
Argument.Output |
getOutput() |
Boolean |
getRequired() |
Boolean |
getSequence() |
String |
getType() |
boolean |
isDefined()
Unset the given option or input.
|
void |
moveTo(int from,
int to)
Move a value from one position in the value list to another.
|
void |
remove(Boolean value)
Remove all occurences of the provided Boolean value from the list of values.
|
void |
remove(Double value)
Remove all occurences of the provided Double value from the list of values.
|
void |
remove(File file,
JobStorage context)
Remove all occurences of the provided File value from the list of values.
|
void |
remove(Integer value)
Remove all occurences of the provided Integer value from the list of values.
|
void |
remove(Long value)
Remove all occurences of the provided Long value from the list of values.
|
void |
remove(String value)
Remove all occurences of the provided String value from the list of values.
|
void |
removeAll(Collection<String> values)
Remove the first occurences of all the provided String values from the list of values.
|
void |
set(Boolean value)
Replace the value with the provided Boolean value.
|
void |
set(Double value)
Replace the value with the provided Double value.
|
void |
set(File file,
JobStorage context)
Replace the value with the provided File value.
|
void |
set(int position,
Boolean value)
Replace the value at the given position with the provided Boolean value.
|
void |
set(int position,
Double value)
Replace the value at the given position with the provided Double value.
|
void |
set(Integer value)
Replace the value with the provided Integer value.
|
void |
set(int position,
File file,
JobStorage context)
Replace the value at the given position with the provided File value.
|
void |
set(int position,
Integer value)
Replace the value at the given position with the provided Integer value.
|
void |
set(int position,
Long value)
Replace the value at the given position with the provided Long value.
|
void |
set(int position,
String value)
Replace the value at the given position with the provided String value.
|
void |
set(Long value)
Replace the value with the provided Long value.
|
void |
set(String value)
Replace the value with the provided String value.
|
void |
setAll(Collection<String> values)
Replace the values with all the provided String values.
|
void |
setDesc(String desc) |
void |
setKind(Argument.Kind kind) |
void |
setMediaTypes(List<String> mediaTypes) |
void |
setName(String name) |
void |
setNicename(String nicename) |
void |
setOrdered(Boolean ordered) |
void |
setOutput(Argument.Output output) |
void |
setRequired(Boolean required) |
void |
setSequence(Boolean sequence) |
void |
setType(String type) |
int |
size()
Returns the number of values defined for the option or input.
|
Document |
toXml() |
void |
unset()
Unset the given option or input.
|
public Argument(Node argumentNode) throws Pipeline2Exception
argumentNode
- the XMLPipeline2Exception
- thrown if an error occurspublic int size()
public void unset()
public boolean isDefined()
public void clear()
public void set(int position, Integer value)
position
- The positionvalue
- the value to usepublic void set(int position, Long value)
position
- The positionvalue
- the value to usepublic void set(int position, Double value)
position
- The positionvalue
- the value to usepublic void set(int position, Boolean value)
position
- The positionvalue
- the value to usepublic void set(int position, File file, JobStorage context)
position
- The positionfile
- the file to usecontext
- the job contextpublic void set(int position, String value)
position
- The positionvalue
- the value to usepublic void set(Integer value)
value
- the value to usepublic void set(Long value)
value
- the value to usepublic void set(Double value)
value
- the value to usepublic void set(Boolean value)
value
- the value to usepublic void set(File file, JobStorage context)
file
- the file to usecontext
- the job contextpublic void set(String value)
value
- the value to usepublic void setAll(Collection<String> values)
values
- the value to usepublic void add(Integer value)
value
- the value to usepublic void add(Long value)
value
- the value to usepublic void add(Double value)
value
- the value to usepublic void add(Boolean value)
value
- the value to usepublic void add(File file, JobStorage context)
file
- the file to usecontext
- the job contextpublic void add(String value)
value
- the value to usepublic void addAll(Collection<String> values)
values
- the values to usepublic void remove(Integer value)
value
- the value to usepublic void remove(Long value)
value
- the value to usepublic void remove(Double value)
value
- the value to usepublic void remove(Boolean value)
value
- the value to usepublic void remove(File file, JobStorage context)
file
- the file to usecontext
- the job contextpublic void remove(String value)
value
- the value to usepublic void removeAll(Collection<String> values)
values
- the value to usepublic Integer getAsInteger()
public Long getAsLong()
public Double getAsDouble()
public Boolean getAsBoolean()
public File getAsFile(JobStorage context)
context
- the job contextpublic String get()
getAsList
to get all values instead.public List<String> getAsList()
public List<File> getAsFileList(JobStorage context)
context
- the job contextpublic void moveTo(int from, int to)
from
- which value to moveto
- which position to move the valuepublic Integer getDefaultValueAsInteger()
public Long getDefaultValueAsLong()
public Double getDefaultValueAsDouble()
public Boolean getDefaultValueAsBoolean()
public File getDefaultValueAsFile(JobStorage context)
context
- the job contextpublic String getDefaultValue()
public String getName()
public String getNicename()
public String getDesc()
public Boolean getRequired()
public Boolean getSequence()
public Argument.Output getOutput()
public Argument.Kind getKind()
public Boolean getOrdered()
public String getType()
public void setName(String name)
public void setNicename(String nicename)
public void setDesc(String desc)
public void setRequired(Boolean required)
public void setSequence(Boolean sequence)
public void setOutput(Argument.Output output)
public void setKind(Argument.Kind kind)
public void setOrdered(Boolean ordered)
public void setType(String type)
public Document toXml()
Copyright © 2012–2022 The DAISY Consortium. All rights reserved.