org.schmant.arg
Class InterpretAsNamedReadableFileStrategy

java.lang.Object
  extended by org.schmant.arg.AbstractArgumentInterpretationStrategy<T>
      extended by org.schmant.arg.AbstractOneToOneArgumentInterpretationStrategy<T>
          extended by org.schmant.arg.AbstractReadableFileArgumentInterpretationStrategy<NamedReadableFile>
              extended by org.schmant.arg.InterpretAsNamedReadableFileStrategy
All Implemented Interfaces:
ArgumentInterpretationStrategy<NamedReadableFile>

public class InterpretAsNamedReadableFileStrategy
extends AbstractReadableFileArgumentInterpretationStrategy<NamedReadableFile>

This strategy is used to interpret objects into read only NamedReadableFile:s. It is documented in the |ai:ai_named_readable_file:User's Guide|.

For most cases, the constants AS_SINGLE and AS_SEVERAL can be used instead of creating a new object.

Since:
1.0
Author:
Karl Gustafsson

Field Summary
static InterpretAsNamedReadableFileStrategy AS_SEVERAL
          This object can be used for interpreting objects into one or several NamedReadableFile objects.
static InterpretAsNamedReadableFileStrategy AS_SINGLE
          This object can be used for interpreting objects into one NamedReadableFile object.
 
Fields inherited from interface org.schmant.arg.ArgumentInterpretationStrategy
ALLOW_NOT_INTERPRETED, ALLOW_ONE_AND_ONLY_ONE_RESULT_OBJECT
 
Constructor Summary
InterpretAsNamedReadableFileStrategy(int... configuration)
           
 
Method Summary
protected  Class<NamedReadableFile> getTargetType()
          Subclasses implement this to return the type that they interpret objects as.
protected  NamedReadableFile interpretObject(Object o, List<String> t)
          Subclasses implement this to interpret the supplied object.
 
Methods inherited from class org.schmant.arg.AbstractReadableFileArgumentInterpretationStrategy
getNamedReadableFileInternal, getReadableFileInternal
 
Methods inherited from class org.schmant.arg.AbstractOneToOneArgumentInterpretationStrategy
interpretList
 
Methods inherited from class org.schmant.arg.AbstractArgumentInterpretationStrategy
checkConfiguration, convertBackslashesToSlashes, getExistingFileFromCharSequence, getParentFile, trace, validateResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AS_SEVERAL

public static final InterpretAsNamedReadableFileStrategy AS_SEVERAL
This object can be used for interpreting objects into one or several NamedReadableFile objects.


AS_SINGLE

public static final InterpretAsNamedReadableFileStrategy AS_SINGLE
This object can be used for interpreting objects into one NamedReadableFile object.

Constructor Detail

InterpretAsNamedReadableFileStrategy

public InterpretAsNamedReadableFileStrategy(int... configuration)
Method Detail

getTargetType

protected Class<NamedReadableFile> getTargetType()
Description copied from class: AbstractArgumentInterpretationStrategy
Subclasses implement this to return the type that they interpret objects as.

Specified by:
getTargetType in class AbstractArgumentInterpretationStrategy<NamedReadableFile>
Returns:
The target type of the interpretation.

interpretObject

protected NamedReadableFile interpretObject(Object o,
                                            List<String> t)
Description copied from class: AbstractOneToOneArgumentInterpretationStrategy
Subclasses implement this to interpret the supplied object.

Specified by:
interpretObject in class AbstractOneToOneArgumentInterpretationStrategy<NamedReadableFile>
Parameters:
o - The object to interpret.
t - The interpretation trace list. The list should be populated by this method.
Returns:
The interpreted object or null if it could not be interpreted.