org.dllearner.core.options
Class URLConfigOption

java.lang.Object
  extended by org.dllearner.core.options.ConfigOption<URL>
      extended by org.dllearner.core.options.URLConfigOption

public class URLConfigOption
extends ConfigOption<URL>

Option which has an URL as value.

Author:
Jens Lehmann

Constructor Summary
URLConfigOption(String name, String description)
           
URLConfigOption(String name, String description, URL defaultValue)
           
URLConfigOption(String name, String description, URL defaultValue, boolean mandatory, boolean requiresInit)
           
 
Method Summary
 boolean checkType(Object object)
          Checks whether the object has the correct type to be used as a value for this option (this method is necessary, because generic information is erased at runtime in Java).
 SortedSet<String> getJavaImports()
          TODO Method should be removed and a mapping table in ConfigJavaGenerator created instead.
 String getValueFormatting(URL value)
          Get a formatted value to put into configuration file.
 String getValueTypeAsJavaString()
           
 boolean isValidValue(URL value)
          Checks whether the value is valid, e.g. passing 1985 as integer value for an option, which requires values between 0 and 1, is not valid.
 boolean refersToFile()
          Returns whether the URI can refer to a file or not, e.g. the URL of an OWL knowledge source does refer to a file whereas the URL of a SPARQL endpoint cannot refer to a file.
 boolean refersToOWLClass()
          Returns whether the URI can refer to a class in a loaded ontology.
 void setRefersToFile(boolean refersToFile)
           
 void setRefersToOWLClass(boolean refersToOWLClass)
           
 
Methods inherited from class org.dllearner.core.options.ConfigOption
getAllowedValuesDescription, getDefaultValue, getDefaultValueInJava, getDescription, getJavaDocString, getName, isMandatory, requiresInit, setDefaultValue, setMandatory, setRequiresInit, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

URLConfigOption

public URLConfigOption(String name,
                       String description)

URLConfigOption

public URLConfigOption(String name,
                       String description,
                       URL defaultValue)

URLConfigOption

public URLConfigOption(String name,
                       String description,
                       URL defaultValue,
                       boolean mandatory,
                       boolean requiresInit)
Method Detail

refersToFile

public boolean refersToFile()
Returns whether the URI can refer to a file or not, e.g. the URL of an OWL knowledge source does refer to a file whereas the URL of a SPARQL endpoint cannot refer to a file. The distinction can be useful in GUIs (e.g. they may offer to choose a local file).

Returns:
the refersToFile

setRefersToFile

public void setRefersToFile(boolean refersToFile)
Parameters:
refersToFile - Set whether this option can refer to a file.

refersToOWLClass

public boolean refersToOWLClass()
Returns whether the URI can refer to a class in a loaded ontology. This can be used in user interfaces for this component.

Returns:
the refersToOWLClass Whether it refers to an OWL class.

setRefersToOWLClass

public void setRefersToOWLClass(boolean refersToOWLClass)
Parameters:
refersToFile - Set whether this option refers to an OWL class in the loaded ontology.

checkType

public boolean checkType(Object object)
Description copied from class: ConfigOption
Checks whether the object has the correct type to be used as a value for this option (this method is necessary, because generic information is erased at runtime in Java).

Specified by:
checkType in class ConfigOption<URL>
Parameters:
object - The object to check.
Returns:
True of the type is correct, false otherwise.

getValueFormatting

public String getValueFormatting(URL value)
Description copied from class: ConfigOption
Get a formatted value to put into configuration file.

Specified by:
getValueFormatting in class ConfigOption<URL>
Parameters:
value - Option value.
Returns:
A string to put into a conf file.

getValueTypeAsJavaString

public String getValueTypeAsJavaString()
Specified by:
getValueTypeAsJavaString in class ConfigOption<URL>

isValidValue

public boolean isValidValue(URL value)
Description copied from class: ConfigOption
Checks whether the value is valid, e.g. passing 1985 as integer value for an option, which requires values between 0 and 1, is not valid.

Specified by:
isValidValue in class ConfigOption<URL>
Parameters:
value - A value for the option.
Returns:
True if the value is valid and false otherwise.

getJavaImports

public SortedSet<String> getJavaImports()
Description copied from class: ConfigOption
TODO Method should be removed and a mapping table in ConfigJavaGenerator created instead. gets java imports

Overrides:
getJavaImports in class ConfigOption<URL>
Returns:
Java imports.


SourceForge.net Logo DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2011 Jens Lehmann