|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.schmant.arg.AbstractArgumentInterpreter
org.schmant.arg.ArgumentInterpreter
public class ArgumentInterpreter
This class is used for interpreting untyped arguments into something that a
task might find useful. A running Schmant program uses a singleton instance
of this class (or of any other implementation, see below). This instance can
be retrieved by calling the static getInstance()
method.
The implementation of this class may change in the future as new innovative ways of interpreting untyped arguments are discovered.
All the decisions that the methods in this class make are logged to trace
(FINEST) level by calling the AbstractArgumentInterpreter.trace(List, String)
method. If any
method fails, the decisions are included in the error message.
Another ArgumentInterpreter
implementation can be used by setting the
org.schmant.arg.argumentInterpreter
system property to the fully
qualified class name of that implementation. Implementations are required to
have a constructor without arguments.
This class is further documented in its own appendix in the User's guide.
Field Summary | |
---|---|
static String |
SP_IMPLEMENTATION
The name of the system property that may contain the fully qualified name of the argument interpreter implementation to use. |
Constructor Summary | |
---|---|
protected |
ArgumentInterpreter()
Constructor. |
Method Summary | ||
---|---|---|
File |
getDirectory(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
EntityHolder |
getEntityHolder(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
protected EntityHolder |
getEntityHolderInternal(Object o,
List<String> t)
Deprecated. |
|
File |
getFile(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
File |
getFileOrNull(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
protected File |
getFileOrNullInternal(Object o,
List<String> t)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
FutureEntity |
getFutureEntity(Object o,
Object source)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
protected FutureEntity |
getFutureEntityForFile(File f,
RelativeLocation rel,
List<String> t)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
FutureEntity |
getFutureEntityOrNull(Object o,
Object source)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
protected FutureEntity |
getFutureEntityOrNullInternal(Object o,
Object source,
List<String> t)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
static ArgumentInterpreter |
getInstance()
Get the singleton instance of this class. |
|
NamedReadableFile |
getNamedReadableFile(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
protected NamedReadableFile |
getNamedReadableFileForUri(CharSequence cs,
List<String> t)
Deprecated. |
|
NamedReadableFile |
getNamedReadableFileOrNull(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
protected NamedReadableFile |
getNamedReadableFileOrNullInternal(Object o,
List<String> t)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
WritableFile |
getNewWritableFile(Object o,
OverwriteStrategy overwriteStrategy)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
protected WritableFile |
getNewWritableFileInternal(Object o,
OverwriteStrategy overwriteStrategy,
List<String> t)
Deprecated. |
|
protected Object |
getProduced(Producer<?> p,
List<String> t)
Get the produced object from a Producer , throwing an exception
if the task has not been run yet. |
|
RandomlyAccessibleFile |
getRandomlyAccessibleFile(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
protected RandomlyAccessibleFile |
getRandomlyAccessibleFileForUri(CharSequence cs,
List<String> t)
Deprecated. |
|
RandomlyAccessibleFile |
getRandomlyAccessibleFileOrNull(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
protected RandomlyAccessibleFile |
getRandomlyAccessibleFileOrNullInternal(Object o,
List<String> t)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
ReadableFile |
getReadableFile(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
ReadableFile |
getReadableFileOrNull(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
protected ReadableFile |
getReadableFileOrNullInternal(Object o,
List<String> t)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
DirectoryRepresentation |
getReadOnlyDirectory(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
protected DirectoryView |
getReadOnlyDirectoryInternal(Object o,
List<String> t)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
DirectoryRepresentation |
getReadOnlyDirectoryOrNull(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
protected DirectoryRepresentation |
getReadOnlyDirectoryOrNullInternal(Object o,
List<String> t)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
EntityView |
getReadOnlyEntity(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
EntityView |
getReadOnlyEntityOrNull(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
protected EntityView |
getReadOnlyEntityOrNullInternal(Object o,
List<String> t)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
EFile |
getReadOnlyFile(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
EFile |
getReadOnlyFileOrNull(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
protected EFile |
getReadOnlyFileOrNullInternal(Object o,
List<String> t)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
DirectoryRepresentation |
getReadWriteDirectory(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
protected DirectoryView |
getReadWriteDirectoryInternal(Object o,
List<String> t)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
DirectoryRepresentation |
getReadWriteDirectoryOrNull(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
protected DirectoryRepresentation |
getReadWriteDirectoryOrNullInternal(Object o,
List<String> t)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
EntityView |
getReadWriteEntity(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
EntityView |
getReadWriteEntityOrNull(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
protected EntityView |
getReadWriteEntityOrNullInternal(Object o,
List<String> t)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
EFile |
getReadWriteFile(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
EFile |
getReadWriteFileOrNull(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
protected EFile |
getReadWriteFileOrNullInternal(Object o,
List<String> t)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
URL |
getUrl(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
URL |
getUrlOrNull(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
protected URL |
getUrlOrNullInternal(Object o,
List<String> t)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
WritableFile |
getWritableFile(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
WritableFile |
getWritableFileOrNull(Object o)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
protected WritableFile |
getWritableFileOrNullInternal(Object o,
List<String> t)
Deprecated. Use the interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release. |
|
|
interpret(Object o,
ArgumentInterpretationStrategy<T> strat)
Interpret the supplied object into one or several objects of the desired target type using an interpretation strategy. |
|
|
interpretPreInterpreted(List<Object> l,
ArgumentInterpretationStrategy<T> strat)
Interpret each object in a pre-interpreted list of objects (see preInterpret(Object) ) using the supplied interpretation
strategy. |
|
List<Object> |
preInterpret(Object o)
Pre-interpret the supplied object. |
Methods inherited from class org.schmant.arg.AbstractArgumentInterpreter |
---|
trace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SP_IMPLEMENTATION
ArgumentInterpreter
) is used.
Constructor Detail |
---|
protected ArgumentInterpreter()
getInstance()
method
instead.
Method Detail |
---|
public static ArgumentInterpreter getInstance()
ArgumentInterpreter
.protected Object getProduced(Producer<?> p, List<String> t) throws ArgumentInterpretationException
Producer
, throwing an exception
if the task has not been run yet.
p
- The producer.t
- The decision list. (See AbstractArgumentInterpreter.trace(List, String)
). This
argument may be null
.
ArgumentInterpretationException
- If the produced object was
null
.@Deprecated protected File getFileOrNullInternal(Object o, List<String> t)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
Object
as a java.io.File
.
o
- The object to interpret.t
- The decision list. (See AbstractArgumentInterpreter.trace(List, String)
). This
argument may be null
.
File
object, or null
if the object could not
be interpreted.@Deprecated public File getFileOrNull(Object o)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
File
. This may be a file or a
directory.
This method is mostly used by methods that need to be able to resolve the
File
's position in the file system, i.e. mostly methods that run
external commands.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The presumed file.
null
if the argument
could not be interpreted as a java.io.File
.@Deprecated public File getFile(Object o) throws ArgumentInterpretationException
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
File
. This may be a file or
a directory, in an absolute or relative path.
This method is mostly used by methods that need to be able to resolve the
File
's position in the file system, i.e. mostly methods that run
external commands.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The presumed file.
File
object represents an existing file or directory in the file system.
ArgumentInterpretationException
- If the argument cannot be
interpreted as a java.io.File
.@Deprecated public File getDirectory(Object o) throws ArgumentInterpretationException
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
File
(directory).
This method is mostly used by methods that need to be able to resolve the directory's position in the file system, i.e. mostly methods that run external commands.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The presumed directory.
File
object represents an existing directory in the file system.
ArgumentInterpretationException
- If the argument cannot be
interpreted as a directory java.io.File
.@Deprecated protected URL getUrlOrNullInternal(Object o, List<String> t) throws ArgumentInterpretationException
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
Object
as a
ReadableFile
.
o
- The argument to interpret.t
- The decision list. (See AbstractArgumentInterpreter.trace(List, String)
). This
argument may be null
.
null
if the argument could not be
interpreted as a read only entity.
ArgumentInterpretationException
- If the method encounters any
errors during interpretation.@Deprecated public URL getUrlOrNull(Object o) throws ArgumentInterpretationException
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
URL
, returning null
if it cannot be interpreted as an URL
.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The presumed URL.
null
ArgumentInterpretationException
- If the method encounters any
errors during interpretation.@Deprecated public URL getUrl(Object o) throws ArgumentInterpretationException
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
URL
.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The presumed URL.
ArgumentInterpretationException
- If the argument cannot be
interpreted as a java.net.URL
.@Deprecated protected EntityView getReadOnlyEntityOrNullInternal(Object o, List<String> t)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
Object
as a
ReadableFile
.
o
- The argument to interpret.t
- The decision list. (See AbstractArgumentInterpreter.trace(List, String)
). This
argument may be null
.
null
if the argument could not be
interpreted as a read only entity.@Deprecated public EntityView getReadOnlyEntityOrNull(Object o)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
EntityView
.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.
null
if the argument could not be
interpreted as a read only entity.@Deprecated public EntityView getReadOnlyEntity(Object o) throws ArgumentInterpretationException
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
EntityView
.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.
ArgumentInterpretationException
- If the argument cannot be
interpreted as an entity.@Deprecated protected DirectoryView getReadOnlyDirectoryInternal(Object o, List<String> t)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
Object
as a read only
DirectoryView
.
o
- The object to interpret.t
- The decision list. (See AbstractArgumentInterpreter.trace(List, String)
). This
argument may be null
.
null
if the argument could not be
interpreted.@Deprecated protected DirectoryRepresentation getReadOnlyDirectoryOrNullInternal(Object o, List<String> t)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
Object
as a read only
directory representation.
o
- The object to interpret.t
- The decision list. (See AbstractArgumentInterpreter.trace(List, String)
). This
argument may be null
.
null
if the
argument could not be interpreted.@Deprecated public DirectoryRepresentation getReadOnlyDirectoryOrNull(Object o)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
DirectoryView
and possibly
an entity Filter
to use when iterating over the directory.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.
null
if the argument could not
be interpreted as a DirectoryView
.@Deprecated public DirectoryRepresentation getReadOnlyDirectory(Object o) throws ArgumentInterpretationException
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
DirectoryView
and possibly
an entity Filter
for selecting which entities to return when
iterating over the directory.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.
ArgumentInterpretationException
- On interpretation errors.@Deprecated protected EntityHolder getEntityHolderInternal(Object o, List<String> t) throws ArgumentInterpretationException
ArgumentInterpretationException
@Deprecated public EntityHolder getEntityHolder(Object o) throws ArgumentInterpretationException
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
EntityHolder
object, which is a kind
of very limited, read only directory.
This method is documented in the ArgumentInterpreted
appendix in
the User's guide. See here.
o
- The argument to interpret.
EntityHolder
.
ArgumentInterpretationException
- On interpretation errors.@Deprecated protected EFile getReadOnlyFileOrNullInternal(Object o, List<String> t)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
Object
as an EFile
.
o
- The object to interpret.t
- The decision list. (See AbstractArgumentInterpreter.trace(List, String)
). This
argument may be null
.
EFile
, or null
if the object could not be
interpreted.@Deprecated public EFile getReadOnlyFileOrNull(Object o)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
EFile
.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.
@Deprecated public EFile getReadOnlyFile(Object o) throws ArgumentInterpretationException
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
EFile
.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.
ArgumentInterpretationException
- On interpretation errors.@Deprecated protected EntityView getReadWriteEntityOrNullInternal(Object o, List<String> t)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
Object
as a
read/write EntityView
.
o
- The object to interpret.t
- The decision list. (See AbstractArgumentInterpreter.trace(List, String)
). This
argument may be null
.
EntityView
, or null
if the object
could not be interpreted.@Deprecated public EntityView getReadWriteEntityOrNull(Object o)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
EntityView
.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.
null
if the argument could not be
interpreted.@Deprecated public EntityView getReadWriteEntity(Object o) throws ArgumentInterpretationException
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
EntityView
.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.
ArgumentInterpretationException
- On interpretation errors.@Deprecated protected DirectoryView getReadWriteDirectoryInternal(Object o, List<String> t)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
Object
as a
read/write DirectoryView
.
o
- The object to interpret.t
- The decision list. (See AbstractArgumentInterpreter.trace(List, String)
). This
argument may be null
.
null
if the argument
could not be interpreted.@Deprecated protected DirectoryRepresentation getReadWriteDirectoryOrNullInternal(Object o, List<String> t)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
Object
as a
read/write directory representation.
o
- The object to interpret.t
- The decision list. (See AbstractArgumentInterpreter.trace(List, String)
). This
argument may be null
.
null
if the
argument could not be interpreted.@Deprecated public DirectoryRepresentation getReadWriteDirectoryOrNull(Object o)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
DirectoryView
and possibly
an entity Filter
to use when iterating over the directory.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.
DirectoryRepresentation
containing a read/write
directory and possibly an entity Filter
, or null
if the
argument could not be interpreted.@Deprecated public DirectoryRepresentation getReadWriteDirectory(Object o) throws ArgumentInterpretationException
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
DirectoryView
and possibly an entity Filter
to use when iterating over the
directory.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.
DirectoryRepresentation
.
ArgumentInterpretationException
- On interpretation errors.@Deprecated protected EFile getReadWriteFileOrNullInternal(Object o, List<String> t)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
Object
as a
read/write EFile
.
o
- The object to interpret.t
- The decision list. (See AbstractArgumentInterpreter.trace(List, String)
). This
argument may be null
.
EFile
, or null
if the argument could
not be interpreted.@Deprecated public EFile getReadWriteFileOrNull(Object o)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
EFile
.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.
EFile
, or null
if the argument could
not be interpreted.@Deprecated public EFile getReadWriteFile(Object o) throws ArgumentInterpretationException
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
EFile
.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.
EFile
.
ArgumentInterpretationException
- On interpretation errors.@Deprecated protected FutureEntity getFutureEntityForFile(File f, RelativeLocation rel, List<String> t)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
FutureEntity
from a
File
object. If the File
exists, a FutureEntity
is built on the File
. If not, a FutureEntity
is built on
the nearest existing parent directory.
This method calls itself recursively until it finds the nearest existing parent directory if the file does not exist.
f
- The File
.rel
- The relative location to append to the supplied File
to get the future entity.t
- The decision list. (See AbstractArgumentInterpreter.trace(List, String)
). This
argument may be null
.
@Deprecated protected FutureEntity getFutureEntityOrNullInternal(Object o, Object source, List<String> t)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
Object
as a FutureEntity
.
o
- The object to interpret.t
- The decision list. (See AbstractArgumentInterpreter.trace(List, String)
). This
argument may be null
.
null
if the argument could not be
interpreted.@Deprecated public FutureEntity getFutureEntityOrNull(Object o, Object source)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
FutureEntity
.
Some tasks may not like Strings and Files interpreted as FutureEntity:s since they may lack parent directories.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.source
- An source entity that can be used by a
FutureEntityStrategy
. This may be null
.
null
if the argument could not be
interpreted.@Deprecated public FutureEntity getFutureEntity(Object o, Object source) throws ArgumentInterpretationException
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
FutureEntity
.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.source
- An source entity that can be used by a
FutureEntityStrategy
. This can be null
.
ArgumentInterpretationException
- On interpretation errors.@Deprecated protected NamedReadableFile getNamedReadableFileForUri(CharSequence cs, List<String> t)
@Deprecated protected NamedReadableFile getNamedReadableFileOrNullInternal(Object o, List<String> t)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
Object
as a NamedReadableFile
.
o
- The object to interpret.t
- The decision list. (See AbstractArgumentInterpreter.trace(List, String)
). This
argument may be null
.
null
if the argument could not
be interpreted.@Deprecated public NamedReadableFile getNamedReadableFileOrNull(Object o)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
NamedReadableFile
.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.
null
if the argument could not
be interpreted.@Deprecated public NamedReadableFile getNamedReadableFile(Object o) throws ArgumentInterpretationException
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
NamedReadableFile
.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.
ArgumentInterpretationException
- On interpretation errors.@Deprecated protected ReadableFile getReadableFileOrNullInternal(Object o, List<String> t)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
Object
as a readable
file.
o
- The object to interpret.t
- The decision list. (See AbstractArgumentInterpreter.trace(List, String)
). This
argument may be null
.
null
if the argument could not be
interpreted.@Deprecated public ReadableFile getReadableFileOrNull(Object o)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
ReadableFile
.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.
null
if the argument cannot be
interpreted.@Deprecated public ReadableFile getReadableFile(Object o) throws ArgumentInterpretationException
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
ReadableFile
.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.
ArgumentInterpretationException
- On interpretation errors.@Deprecated protected RandomlyAccessibleFile getRandomlyAccessibleFileForUri(CharSequence cs, List<String> t)
@Deprecated protected RandomlyAccessibleFile getRandomlyAccessibleFileOrNullInternal(Object o, List<String> t)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
Object
as a randomly
accessible file.
o
- The object to interpret.t
- The decision list. (See AbstractArgumentInterpreter.trace(List, String)
). This
argument may be null
.
null
if the argument could not be
interpreted.@Deprecated public RandomlyAccessibleFile getRandomlyAccessibleFileOrNull(Object o)
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
RandomlyAccessibleFile
.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.
null
if the argument cannot be
interpreted.@Deprecated public RandomlyAccessibleFile getRandomlyAccessibleFile(Object o) throws ArgumentInterpretationException
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
RandomlyAccessibleFile
.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.
ArgumentInterpretationException
- On interpretation errors.@Deprecated protected WritableFile getWritableFileOrNullInternal(Object o, List<String> t) throws ArgumentInterpretationException
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
Object
as a writable
file.
o
- The object to interpret.t
- The decision list. (See AbstractArgumentInterpreter.trace(List, String)
). This
argument may be null
.
null
if the argument could not be
interpreted.
ArgumentInterpretationException
@Deprecated public WritableFile getWritableFileOrNull(Object o) throws ArgumentInterpretationException
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
WritableFile
. The file
must already exist.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.
null
if the argument cannot be
interpreted.
ArgumentInterpretationException
@Deprecated public WritableFile getWritableFile(Object o) throws ArgumentInterpretationException
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
WritableFile
. The file
must already exist.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The argument to interpret.
ArgumentInterpretationException
- On interpretation errors.@Deprecated protected WritableFile getNewWritableFileInternal(Object o, OverwriteStrategy overwriteStrategy, List<String> t)
@Deprecated public WritableFile getNewWritableFile(Object o, OverwriteStrategy overwriteStrategy) throws ArgumentInterpretationException
interpret(Object, ArgumentInterpretationStrategy)
method instead. This method will be removed in a future release.
WritableFile
. This
method creates the file and returns it. If there already is an entity at
the target location, the overwrite strategy decides what to do with it.
This method is documented in the ArgumentInterpreter
appendix in
the User's guide. See here.
o
- The object to interpret.overwriteStrategy
- The overwrite strategy.
ArgumentInterpretationException
- On argument interpreter errors
or if there already is an entity in the target location that the overwrite
strategy prevented us from overwriting.public List<Object> preInterpret(Object o)
FlatteningList
). If there are
any Producer
:s in the list, they are replaced by their produced
objects in the returned list.
The returned list is ready to be passed to the
interpretPreInterpreted(List, ArgumentInterpretationStrategy)
method.
o
- The object to pre-interpret. This may be a single object or an
array or Collection
of objects.
Producer
:s replaced for the objects that they produce.preInterpret(Object)
public <T> ArgumentInterpretationResult<T> interpretPreInterpreted(List<Object> l, ArgumentInterpretationStrategy<T> strat) throws ArgumentInterpretationException
preInterpret(Object)
) using the supplied interpretation
strategy.
T
- The target type, decided by the interpretation strategy.l
- The list of objects to interpret. This must be the whole of or
a part of a list that has been pre-interpreted.strat
- The interpretation strategy.
ArgumentInterpretationException
- On interpretation errors.preInterpret(Object)
,
interpret(Object, ArgumentInterpretationStrategy)
public <T> ArgumentInterpretationResult<T> interpret(Object o, ArgumentInterpretationStrategy<T> strat) throws ArgumentInterpretationException
This method first invokes preInterpret(Object)
and then
interpretPreInterpreted(List, ArgumentInterpretationStrategy)
.
Note: If a client wants to try to interpret an object using
several strategies, this method cannot be used. Instead, use
preInterpret(Object)
once first, and then
interpretPreInterpreted(List, ArgumentInterpretationStrategy)
for each strategy.
T
- The target type, decided by the interpretation strategy.o
- The object to interpret. This may be a single object, or an
array or collection of objects.strat
- The interpretation strategy. This is used for the
interpretation and to validate the result.
ArgumentInterpretationException
- On interpretation errors.preInterpret(Object o)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |