public class OptionSet
extends java.lang.Object
SecureRequest
class.Modifier and Type | Method and Description |
---|---|
void |
addTo(OptionSet target)
Add all options to a target option set.
|
void |
clearAllOptions()
Clears all options from the option set.
|
void |
clearOption(Option option)
Clears a given option from the option set.
|
boolean |
compare(OptionSet set)
Type specific version of the equals method
|
void |
copyTo(OptionSet target)
Copy all options to a target option set.
|
void |
copyTo(OptionSet target,
Option option)
Copy a single option to a target option set.
|
OptionSet |
createBasedOn()
Creates a new option set with the same option values as this option set.
|
boolean |
equals(java.lang.Object obj)
Equals
|
AnalyzeOption.Action |
getOption(AnalyzeOption target)
Gets the action associated with one of the targets in
SecureOptions |
boolean |
getOption(BooleanOption option)
Gets a boolean option
|
java.util.Date |
getOption(DateOption option)
Gets a date option
|
java.io.File |
getOption(DirectoryOption option)
Gets a directory option
|
Duration |
getOption(DurationOption option)
Gets a duration option
|
EnumOptionValue[] |
getOption(EnumListOption option)
Gets a enum list option
|
EnumOptionValue |
getOption(EnumOption option)
Gets an enum option
|
FileFormat[] |
getOption(FileFormatListOption option)
Gets a file format list option
|
FileFormat |
getOption(FileFormatOption option)
Gets a file format option
|
FileOptionValue[] |
getOption(FileListOption option)
Gets a file list option
|
FileOptionValue |
getOption(FileOption option)
Gets a file option
|
double |
getOption(FloatOption option)
Gets an float option
|
ElementHandler |
getOption(HandlerOption option)
Gets a handler option
|
long |
getOption(IntegerOption option)
Gets an integer option
|
java.lang.Object[] |
getOption(ObjectListOption option)
Gets an object list option.
|
java.lang.Object |
getOption(ObjectOption option)
Gets an object option.
|
ScrubOption.Action |
getOption(ScrubOption target)
Gets the action associated with one of the scrub targets in
SecureOptions |
java.lang.String[] |
getOption(StringListOption option)
Gets a string list option
|
java.lang.String |
getOption(StringOption option)
Gets a string option
|
int |
getOptionEnumAsInt(EnumOption option)
Gets an enum option as integer
This method is provided for efficency in the C/C++ API
and should not be called directly.
|
int |
getOptionFileFormatAsInt(FileFormatOption option)
Gets a file format option as unique id
This method is provided for efficency in the C/C++ API
and should not be called directly.
|
int[] |
getOptionFileFormatListAsIntArray(FileFormatListOption option)
Gets a file format list option
This method is provided for efficency in the C/C++ API
and should not be called directly.
|
org.xml.sax.ContentHandler |
getXMLHandler(org.xml.sax.XMLReader reader)
Gets an implementation of a SAX ContentHandler that
will read and verify the XML subtree written by the
writeXML(ContentHandler ch) method. |
boolean |
isSet(Option option)
Tests if a given option has been set
|
static OptionSet |
newEmptyOptionSet()
Creates an option set with no options set.
|
void |
readXML(java.io.File file)
Reads options from an option set file previously saved using writeXML
|
static void |
registerOptions(OptionContainer options)
Registers a set of options.
|
void |
setOption(AnalyzeOption target,
AnalyzeOption.Action action)
Sets an action on one of the targets in
SecureOptions |
void |
setOption(BooleanOption option,
boolean value)
Sets a boolean option
|
void |
setOption(DateOption option,
java.util.Date value)
Sets a date option
|
void |
setOption(DateOption option,
int year,
int month,
int day,
int hour,
int minute,
int second)
Sets a date option
|
void |
setOption(DirectoryOption option,
java.io.File value)
Sets a directory option
|
void |
setOption(DurationOption option,
Duration value)
Sets a duration option
|
void |
setOption(DurationOption option,
int value)
Sets a duration option
|
void |
setOption(EnumListOption option,
EnumOptionValue[] values)
Sets a enum list option
|
void |
setOption(EnumListOption option,
int[] values)
Sets a enum list option using unique ids
This method is provided for efficency in the C/C++ API
and should not be called directly.
|
void |
setOption(EnumOption option,
EnumOptionValue value)
Sets an enum option
|
void |
setOption(EnumOption option,
int value)
Sets an enum option using its unique id.
|
void |
setOption(FileFormatListOption option,
FileFormat[] value)
Sets a file format list option
|
void |
setOption(FileFormatListOption option,
int[] values)
Sets a file format list option using unique ids
This method is provided for efficency in the C/C++ API
and should not be called directly.
|
void |
setOption(FileFormatOption option,
FileFormat value)
Sets a file format option
|
void |
setOption(FileFormatOption option,
int value)
Sets a file format option using the format's unique id
This method is provided for efficency in the C/C++ API
and should not be called directly.
|
void |
setOption(FileListOption option,
java.io.File[] files)
Sets a file list option
|
void |
setOption(FileListOption option,
FileOptionValue[] files)
Sets a file list option
|
void |
setOption(FileOption option,
java.nio.ByteBuffer value)
Sets a file option using a ByteBuffer
|
void |
setOption(FileOption option,
java.io.File value)
Sets a file option using a File object
|
void |
setOption(FileOption option,
java.nio.channels.FileChannel value)
Sets a file option using a FileChannel
|
void |
setOption(FileOption option,
java.io.InputStream value)
Sets a file option using a InputStream
|
void |
setOption(FileOption option,
java.io.OutputStream value)
Sets a file option using a OutputStream
|
void |
setOption(FileOption option,
SimpleChannel value)
Sets a file option using a SimpleChannel
|
void |
setOption(FileOption option,
java.net.URL value)
Sets a file option using a URL object
|
void |
setOption(FloatOption option,
double value)
Sets an float option
|
void |
setOption(HandlerOption option,
ElementHandler handler)
Sets a handler option.
|
void |
setOption(IntegerOption option,
long value)
Sets an integer option
|
void |
setOption(ObjectListOption option,
java.lang.Object[] value)
Sets an object list option.
|
void |
setOption(ObjectOption option,
java.lang.Object value)
Sets an object option.
|
void |
setOption(ScrubOption target,
ScrubOption.Action action)
Sets an action on one of the targets in
SecureOptions |
void |
setOption(StringListOption option,
java.lang.String[] value) |
void |
setOption(StringOption option,
java.lang.String value)
Sets a string option
|
void |
writeXML(org.xml.sax.ContentHandler ch)
Persists the option set as an XML subtree to an existsing
SAX ContentHandler.
|
void |
writeXML(org.xml.sax.ContentHandler ch,
Option option)
Persists a single option to an existsing
SAX ContentHandler.
|
void |
writeXML(java.io.File file)
Persists the option set to a file.
|
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean compare(OptionSet set)
set
- option set to compare to this onepublic static OptionSet newEmptyOptionSet()
public boolean isSet(Option option)
option
- The option to testpublic void clearOption(Option option)
option
- The option to clearpublic void clearAllOptions()
public void copyTo(OptionSet target)
target
- An option set that will receive a copy of the options. Any existing options in this target set will be removed.public void addTo(OptionSet target)
target
- An option set that will receive a copy of the options. Any other existing options in this target will be preserved.public void copyTo(OptionSet target, Option option)
target
- An option set that will receive a copy of the option.option
- The option to copy.public OptionSet createBasedOn()
public void setOption(EnumOption option, EnumOptionValue value)
option
- The EnumOption
to setvalue
- The value this option should takepublic void setOption(EnumOption option, int value)
option
- The EnumOption
to setvalue
- The value this option should takepublic EnumOptionValue getOption(EnumOption option)
option
- The EnumOption
to getpublic int getOptionEnumAsInt(EnumOption option)
option
- The EnumOption
to getpublic void setOption(EnumListOption option, EnumOptionValue[] values)
option
- The EnumListOption
to setvalues
- The values this option should takepublic void setOption(EnumListOption option, int[] values)
option
- The EnumListOption
to setvalues
- The values this option should takepublic EnumOptionValue[] getOption(EnumListOption option)
option
- The EnumListOption
to getpublic void setOption(BooleanOption option, boolean value)
option
- The BooleanOption
to setvalue
- The value this option should takepublic boolean getOption(BooleanOption option)
option
- The BooleanOption
to getpublic void setOption(StringOption option, java.lang.String value)
option
- The StringOption
to setvalue
- The value this option should takepublic java.lang.String getOption(StringOption option)
option
- The StringOption
to getpublic void setOption(DateOption option, java.util.Date value)
option
- The DateOption
to setvalue
- The value this option should takepublic void setOption(DateOption option, int year, int month, int day, int hour, int minute, int second)
option
- The DateOption
to setyear
- The year, value is ADmonth
- The month, value is 0-based where 0 is Januaryday
- Day of the monthhour
- Hourminute
- Minutesecond
- Secondpublic java.util.Date getOption(DateOption option)
option
- The DateOption
to getpublic void setOption(DurationOption option, Duration value)
option
- The DurationOption
to setvalue
- The value this option should takepublic void setOption(DurationOption option, int value)
option
- The DurationOption
to setvalue
- The duration in millisecondspublic Duration getOption(DurationOption option)
option
- The DurationOption
to getpublic void setOption(StringListOption option, java.lang.String[] value)
public java.lang.String[] getOption(StringListOption option)
option
- The StringListOption
to getpublic void setOption(IntegerOption option, long value)
option
- The IntegerOption
to setvalue
- The value this option should takepublic long getOption(IntegerOption option)
option
- The IntegerOption
to getpublic void setOption(FloatOption option, double value)
option
- The FloatOption
to setvalue
- The value this option should takepublic double getOption(FloatOption option)
option
- The FloatOption
to getpublic void setOption(ObjectOption option, java.lang.Object value)
This method should be used to set options that take objects from other packages.
option
- The Option
to setvalue
- The value this option should takepublic java.lang.Object getOption(ObjectOption option)
This method should be used only as an option extensibility mechanism and cannot be used to get any of Bitform's standard options.
option
- The Option
to setpublic void setOption(ObjectListOption option, java.lang.Object[] value)
This method should be used to set options that take object lists.
option
- The Option
to setvalues
- The list of values this option should takepublic java.lang.Object[] getOption(ObjectListOption option)
option
- The Option
to setpublic void setOption(FileFormatOption option, FileFormat value)
option
- The FileFormatOption
to setvalue
- The value this option should takepublic void setOption(FileFormatOption option, int value)
option
- The FileFormatOption
to setvalue
- The value this option should takepublic FileFormat getOption(FileFormatOption option)
option
- The FileFormatOption
to getpublic int getOptionFileFormatAsInt(FileFormatOption option)
option
- The FileFormatOption
to getpublic void setOption(FileFormatListOption option, FileFormat[] value)
option
- The FileFormatListOption
to setvalue
- The value this option should takepublic void setOption(FileFormatListOption option, int[] values)
option
- The FileFormatListOption
to setvalues
- The value this option should takepublic FileFormat[] getOption(FileFormatListOption option)
option
- The FileFormatListOption
to getpublic int[] getOptionFileFormatListAsIntArray(FileFormatListOption option)
option
- The FileFormatListOption
to getpublic void setOption(DirectoryOption option, java.io.File value)
option
- The DirectoryOption
to setvalue
- The value this option should takepublic java.io.File getOption(DirectoryOption option)
option
- The DirectoryOption
to getpublic void setOption(FileListOption option, FileOptionValue[] files)
option
- The FileListOption
to setfiles
- A non-null array of FileOptionValue objectspublic void setOption(FileListOption option, java.io.File[] files)
option
- The FileListOption
to setfiles
- A non-null array of File objectspublic FileOptionValue[] getOption(FileListOption option)
option
- The FileListOption
to getpublic void setOption(FileOption option, java.io.File value)
option
- The FileOption
to setvalue
- A non-null File object that represents a single filepublic void setOption(FileOption option, java.net.URL value)
option
- TheFileOption
to setvalue
- A non-null URL object that represents a single filepublic void setOption(FileOption option, java.io.InputStream value)
option
- The FileOption
to setvalue
- A non-null InputStream object that represents a
single filepublic void setOption(FileOption option, java.io.OutputStream value)
option
- The FileOption
to setvalue
- A non-null OutputStream object that represents a
single filepublic void setOption(FileOption option, java.nio.channels.FileChannel value)
option
- The FileOption
to setvalue
- A non-null FileChannel object that represents a
single filepublic void setOption(FileOption option, java.nio.ByteBuffer value)
option
- The FileOption
to setvalue
- A non-null ByteBuffer object that represents a
single filepublic void setOption(FileOption option, SimpleChannel value)
option
- The FileOption
to setvalue
- A non-null SimpleChannel object that represents a
single filepublic FileOptionValue getOption(FileOption option)
option
- The FileOption
to getpublic void setOption(ScrubOption target, ScrubOption.Action action)
SecureOptions
target
- One of the ScrubOption fields in SecureOptions
action
- The action to perform on this targetpublic ScrubOption.Action getOption(ScrubOption target)
SecureOptions
target
- One of the fields in SecureOptions
public void setOption(AnalyzeOption target, AnalyzeOption.Action action)
SecureOptions
target
- One of the AnalyzeOption fields in SecureOptions
action
- The action to perform on this targetpublic AnalyzeOption.Action getOption(AnalyzeOption target)
SecureOptions
target
- One of the fields in SecureOptions
public void setOption(HandlerOption option, ElementHandler handler)
option
- A HandlerOptionhandler
- The element handler to associate with this optionpublic ElementHandler getOption(HandlerOption option)
option
- A HandlerOptionpublic static void registerOptions(OptionContainer options)
options
- An option container that should be registeredpublic void writeXML(java.io.File file)
Bitform.OPTIONS_NAMESPACE
.
The persisted file can be loaded back into an option set during construction
of one of the concrete option sets, such as SecureRequest
,
that derive from this class.
file
- File to persist to. File will be overwritten if it already exists.public void writeXML(org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException
Bitform.OPTIONS_NAMESPACE
namespace.
The method allows an option set to be persisted as part of a larger XML file or saved in any other way that can expose a ContentHandler.
ch
- SAX ContentHandler to write the XML subtree to.org.xml.sax.SAXException
public void writeXML(org.xml.sax.ContentHandler ch, Option option) throws org.xml.sax.SAXException
Bitform.OPTIONS_NAMESPACE
namespace.
The method allows a single option to be persisted as part of a larger XML file or saved in any other way that can expose a ContentHandler.
ch
- SAX ContentHandler to write the XML subtree to.option
- The option to persistorg.xml.sax.SAXException
public void readXML(java.io.File file)
file
- An XML file to read the options from. The file must exist.public org.xml.sax.ContentHandler getXMLHandler(org.xml.sax.XMLReader reader)
writeXML(ContentHandler ch)
method.
It is the callers responsibility to send this ContentHandler only
the SAX events for the subtree originally written by
the writeXML(ContentHandler ch)
method.
Any other elements will throw a SAXException.
Copyright © 2021 Oracle. All right reserved. Restricted and confidential property of Oracle. Solely for use by recipent under agreement forbidding disclosure.