public class FileResourceModelSource extends java.lang.Object implements ResourceModelSource, Configurable
Modifier and Type | Class and Description |
---|---|
static class |
FileResourceModelSource.Configuration |
Modifier and Type | Method and Description |
---|---|
void |
configure(FileResourceModelSource.Configuration configuration)
Configure the Source
|
void |
configure(java.util.Properties configs)
Configure the object with the configuration properties.
|
protected ResourceFormatParser |
createParser(java.io.File file,
java.lang.String format)
Create a NodeFileParser given the project and the source file, using the predetermined format
|
INodeSet |
getNodes() |
INodeSet |
getNodes(java.io.File nodesFile,
java.lang.String format)
Returns a
INodeSet object conatining the nodes config data. |
static INodeSet |
parseFile(java.io.File file,
Framework framework,
java.lang.String project)
Utility method to directly parse the nodes from a file
|
static INodeSet |
parseFile(java.io.File file,
java.lang.String format,
Framework framework,
java.lang.String project)
Utility method to directly parse the nodes from a file
|
static INodeSet |
parseFile(java.lang.String file,
Framework framework,
java.lang.String project)
Utility method to directly parse the nodes from a file
|
java.lang.String |
toString() |
public void configure(java.util.Properties configs) throws ConfigurationException
Configurable
configure
in interface Configurable
configs
- the properties to useConfigurationException
- if there is an invalid configurationpublic void configure(FileResourceModelSource.Configuration configuration) throws ConfigurationException
configuration
- configurationConfigurationException
- on config errorpublic INodeSet getNodes() throws ResourceModelSourceException
getNodes
in interface ResourceModelSource
ResourceModelSourceException
public INodeSet getNodes(java.io.File nodesFile, java.lang.String format) throws ResourceModelSourceException
INodeSet
object conatining the nodes config data.nodesFile
- the source fileformat
- nodes formatINodeSet
ResourceModelSourceException
- on errorprotected ResourceFormatParser createParser(java.io.File file, java.lang.String format) throws ResourceModelSourceException
file
- the nodes resource fileformat
- the file formatResourceModelSourceException
- if the format is not supportedpublic static INodeSet parseFile(java.lang.String file, Framework framework, java.lang.String project) throws ResourceModelSourceException, ConfigurationException
file
- fileframework
- fwkproject
- project nameResourceModelSourceException
- if an error occursConfigurationException
- if a configuration error occurspublic static INodeSet parseFile(java.io.File file, Framework framework, java.lang.String project) throws ResourceModelSourceException, ConfigurationException
file
- fileframework
- fwkproject
- project nameResourceModelSourceException
- if an error occursConfigurationException
- if a configuration error occurspublic static INodeSet parseFile(java.io.File file, java.lang.String format, Framework framework, java.lang.String project) throws ResourceModelSourceException, ConfigurationException
file
- fileformat
- specified formatframework
- fwkproject
- project nameResourceModelSourceException
- if an error occursConfigurationException
- if a configuration error occurspublic java.lang.String toString()
toString
in class java.lang.Object