Package org.cytoscape.property
Class AbstractConfigDirPropsReader
java.lang.Object
org.cytoscape.property.AbstractConfigDirPropsReader
- All Implemented Interfaces:
CyProperty<Properties>
An abstract implementation of CyProperty<Properties> that attempts to read the specified
properties file first from the jar file running this code and then appends any properties
found in the local configuration directory to that properties object. The config
directory used is
This class must be extended so that it will read from the proper jar file. In general simply implementing a constructor should be sufficient:
CyProperty.DEFAULT_PROPS_CONFIG_DIR
.
This class must be extended so that it will read from the proper jar file. In general simply implementing a constructor should be sufficient:
public class PropsReader extends AbstractConfigDirPropsReader { PropsReader(String s, SavePolicy sp) { super(s,sp); } }
Cytoscape Backwards Compatibility (Abstract Class): This class is abstract and meant to be extended by users. This means that we may add methods for minor version updates. Methods will only be removed for major version updates.
Module: property-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>property-api</artifactId> </dependency>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cytoscape.property.CyProperty
CyProperty.SavePolicy
-
Field Summary
Modifier and TypeFieldDescriptionprotected final String
The name of this CyProperty.protected final Properties
The Properties object created for this class.protected final CyProperty.SavePolicy
The SavePolicy of this CyProperty.Fields inherited from interface org.cytoscape.property.CyProperty
DEFAULT_PROPS_CONFIG_DIR
-
Constructor Summary
ConstructorDescriptionAbstractConfigDirPropsReader
(String name, String propFileName, CyProperty.SavePolicy savePolicy) Creates a new AbstractConfigDirPropsReader object. -
Method Summary
Modifier and TypeMethodDescriptiongetName()
Returns the name of the CyProperty.Return a property object.Class<? extends Properties>
Returns the type of the property object.Returns theCyProperty.SavePolicy
of the CyProperty.
-
Field Details
-
name
The name of this CyProperty. -
props
The Properties object created for this class. -
savePolicy
The SavePolicy of this CyProperty.
-
-
Constructor Details
-
AbstractConfigDirPropsReader
public AbstractConfigDirPropsReader(String name, String propFileName, CyProperty.SavePolicy savePolicy) Creates a new AbstractConfigDirPropsReader object.- Parameters:
name
- The name of this CyProperty.propFileName
- The name of the java.util.Properties file to read.savePolicy
- The save policy for this CyProperty. This value MUST be eitherCyProperty.SavePolicy.CONFIG_DIR
orCyProperty.SavePolicy.SESSION_FILE_AND_CONFIG_DIR
so that we can reasonably expect to find a properties file in the configuration directory. If you'd like to use a different SavePolicy, then consider usingSimpleCyProperty
instead.
-
-
Method Details
-
getName
Returns the name of the CyProperty.- Specified by:
getName
in interfaceCyProperty<Properties>
- Returns:
- The name of the CyProperty.
-
getSavePolicy
Returns theCyProperty.SavePolicy
of the CyProperty.- Specified by:
getSavePolicy
in interfaceCyProperty<Properties>
- Returns:
- the
CyProperty.SavePolicy
of the CyProperty.
-
getProperties
Return a property object.- Specified by:
getProperties
in interfaceCyProperty<Properties>
- Returns:
- A property object of type P.
-
getPropertyType
Returns the type of the property object.- Specified by:
getPropertyType
in interfaceCyProperty<Properties>
- Returns:
- the type of the property object.
-