net.sf.freecol.common.option
Class FileOption

java.lang.Object
  extended by net.sf.freecol.common.model.FreeColObject
      extended by net.sf.freecol.common.option.AbstractOption
          extended by net.sf.freecol.common.option.FileOption
All Implemented Interfaces:
Option

public class FileOption
extends AbstractOption

Represents an option for specifying a File.


Field Summary
private static java.util.logging.Logger logger
           
private  java.io.File value
           
 
Fields inherited from class net.sf.freecol.common.option.AbstractOption
isDefined, NO_ID, previewEnabled
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, PARTIAL_ATTRIBUTE
 
Constructor Summary
FileOption(javax.xml.stream.XMLStreamReader in)
          Creates a new IntegerOption.
 
Method Summary
 java.io.File getValue()
          Gets the current value of this FileOption.
static java.lang.String getXMLElementTagName()
          Gets the tag name of the root element representing this object.
protected  void readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
          Initialize this object from an XML-representation of this object.
 void setValue(java.io.File value)
          Sets the value of this FileOption.
protected  void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
          This method writes an XML-representation of this object to the given stream.
 
Methods inherited from class net.sf.freecol.common.option.AbstractOption
getGroup, getName, getShortDescription, isPreviewEnabled, setGroup, setPreviewEnabled, toString
 
Methods inherited from class net.sf.freecol.common.model.FreeColObject
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAttribute, getAttribute, getAttribute, getAttribute, getId, getPropertyChangeListeners, getPropertyChangeListeners, hasAbility, hasAttribute, hasListeners, readAttributes, readChildren, readFromArrayElement, readFromArrayElement, readFromArrayElement, readFromListElement, readFromXML, readFromXMLElement, readFromXMLPartialImpl, removePropertyChangeListener, removePropertyChangeListener, setId, toArrayElement, toArrayElement, toListElement, toXML, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, toXMLPartialImpl, writeAttribute, writeAttributes, writeChildren, writeFreeColGameObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.freecol.common.option.Option
addPropertyChangeListener, getId, readFromXML, readFromXMLElement, removePropertyChangeListener, toXML, toXMLElement
 

Field Detail

logger

private static java.util.logging.Logger logger

value

private java.io.File value
Constructor Detail

FileOption

public FileOption(javax.xml.stream.XMLStreamReader in)
           throws javax.xml.stream.XMLStreamException
Creates a new IntegerOption.

Parameters:
in - The XMLStreamReader containing the data.
Throws:
javax.xml.stream.XMLStreamException
Method Detail

getValue

public java.io.File getValue()
Gets the current value of this FileOption.

Returns:
The value using null for marking no value.

setValue

public void setValue(java.io.File value)
Sets the value of this FileOption.

Parameters:
value - The value to be set.

toXMLImpl

protected void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
                  throws javax.xml.stream.XMLStreamException
This method writes an XML-representation of this object to the given stream.

Specified by:
toXMLImpl in class FreeColObject
Parameters:
out - The target stream.
Throws:
javax.xml.stream.XMLStreamException - if there are any problems writing to the stream.

readFromXMLImpl

protected void readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
                        throws javax.xml.stream.XMLStreamException
Initialize this object from an XML-representation of this object.

Overrides:
readFromXMLImpl in class FreeColObject
Parameters:
in - The input stream with the XML.
Throws:
javax.xml.stream.XMLStreamException - if a problem was encountered during parsing.

getXMLElementTagName

public static java.lang.String getXMLElementTagName()
Gets the tag name of the root element representing this object.

Returns:
"booleanOption".