JaRMoS  1.1
Java Reduced Model Simulations
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
jarmos.io.FileModelManager Class Reference

Manages models loaded from the file system available via the java.io classes. More...

Inheritance diagram for jarmos.io.FileModelManager:
jarmos.io.AModelManager jarmos.app.io.SDModelManager

Public Member Functions

 FileModelManager ()
 Calls the constructor with the FileModelManager.MODEL_DIR static string as root. More...
 
 FileModelManager (String root)
 
ClassLoader getClassLoader ()
 
boolean modelFileExists (String filename)
 
void writeModelFile (String filename, InputStream in) throws IOException
 Writes the given inputstream to the file specified by filename to the current model directory. More...
 
boolean clearCurrentModel ()
 Removes. More...
 
String getRoot ()
 Returns the root folder for the model directories. More...
 
URI getModelURI ()
 Returns an URI for the current model location/directory. More...
 
- Public Member Functions inherited from jarmos.io.AModelManager
 AModelManager ()
 Constructs a new ModelManager and a private DocumentBuilder and SchemaFactory. More...
 
void addMessageHandler (IMessageHandler h)
 
Object loadModelClass (String name) throws ModelManagerException
 Loads a class available in the precompiled classes associated with the current model. More...
 
BufferedReader getBufReader (String filename) throws IOException
 
ClassLoader getClassLoader ()
 This method yields access to any specialized class loaders in subclasses. More...
 
final InputStream getInStream (String filename) throws IOException
 Returns an InputStream instance streaming the contents of the file given by filename. More...
 
MathObjectReader getMathObjReader ()
 Use this method in order to get a MathObjectReader instance fitted for the current selected model. More...
 
List< ModelDescriptorgetModelDescriptors () throws ModelManagerException
 Scans all directories given by getFolderList() for valid models and returns a list of model descriptors for each valid model. More...
 
List< ModelDescriptorgetModelDescriptors (IProgressReporter pr) throws ModelManagerException
 Scans all directories given by getFolderList() for valid models and returns a list of model descriptors for each valid model. More...
 
String getModelDir ()
 
FieldDescriptor[] getModelFieldTypes ()
 
ModelType getModelType ()
 Returns the model type as given in the model.xml attribute "type" of the "model" tag. More...
 
String getModelXMLAttribute (String attrib_name)
 Returns the attribute value of any attributes of the "model" tag in the model.xml file. More...
 
String getModelXMLAttribute (String attrib_name, String tagname)
 Returns the attribute value of any attributes of the tag given by tagname in the model.xml file. More...
 
String getModelXMLTagValue (String tagname)
 Works as the overload with default value, but returns null if no matchin element is found. More...
 
String getModelXMLTagValue (String tagname, String default_value)
 Returns the text content of a tag inside the model.xml file. More...
 
String getModelPackageStr ()
 Returns the package of any java source files associated with this model. More...
 
Parameters getParameters ()
 Reads the parameters from the model XML file and returns a Parameters object. More...
 
boolean isValidModelDir (String dir)
 Checks if a model.xml file exists in the specified directory and performs xsd-validation. More...
 
void removeMessageHandler (IMessageHandler h)
 
void useModel (String location) throws ModelManagerException
 Sets the specified source as current model path. More...
 
boolean xmlTagExists (String tagname)
 Checks if a specified tag exists inside the current models model.xml file. More...
 

Static Public Attributes

static final String MODEL_DIR = "/home/dwirtz/aghhome/Software/Eclipse/JaRMoS/JaRMoSModels"
 
- Static Public Attributes inherited from jarmos.io.AModelManager
static final String CLASSES_JARFILE = "classes.jar"
 The name of the jar file inside a models directory containing .class files in java bytecode. More...
 
static final String info_filename = "site_info.html"
 The model's info html file name (imported from rbappmit, might change later) More...
 

Protected Member Functions

InputStream getInStreamImpl (String filename) throws FileNotFoundException
 Template method. More...
 
String[] getFolderList () throws IOException
 
String getFullModelPath ()
 
String getLoadingMessage ()
 A short message that writes "loading SD models" dependent on the actual instance. More...
 
- Protected Member Functions inherited from jarmos.io.AModelManager
void sendMessage (String msg)
 

Detailed Description

Manages models loaded from the file system available via the java.io classes.

Takes an initial model root directory upon construction.

Author
Daniel Wirtz

Definition at line 23 of file FileModelManager.java.

Constructor & Destructor Documentation

jarmos.io.FileModelManager.FileModelManager ( )

Calls the constructor with the FileModelManager.MODEL_DIR static string as root.

Definition at line 33 of file FileModelManager.java.

jarmos.io.FileModelManager.FileModelManager ( String  root)
Parameters
root

Definition at line 40 of file FileModelManager.java.

Member Function Documentation

boolean jarmos.io.FileModelManager.clearCurrentModel ( )

Removes.

Parameters
dirname

Definition at line 123 of file FileModelManager.java.

ClassLoader jarmos.io.FileModelManager.getClassLoader ( )
String [] jarmos.io.FileModelManager.getFolderList ( ) throws IOException
protectedvirtual
String jarmos.io.FileModelManager.getFullModelPath ( )
protected

Definition at line 90 of file FileModelManager.java.

InputStream jarmos.io.FileModelManager.getInStreamImpl ( String  filename) throws FileNotFoundException
protectedvirtual

Template method.

Implementations of this method must locate the given file inside the current model directory and return an input stream pointing to it.

Parameters
filenameThe model file to return a stream for
Returns
An InputStream pointing to the resource
Exceptions
IOException

Implements jarmos.io.AModelManager.

Definition at line 69 of file FileModelManager.java.

String jarmos.io.FileModelManager.getLoadingMessage ( )
protectedvirtual

A short message that writes "loading SD models" dependent on the actual instance.

Returns

Implements jarmos.io.AModelManager.

Definition at line 156 of file FileModelManager.java.

URI jarmos.io.FileModelManager.getModelURI ( )
virtual

Returns an URI for the current model location/directory.

Returns

Implements jarmos.io.AModelManager.

Definition at line 151 of file FileModelManager.java.

String jarmos.io.FileModelManager.getRoot ( )

Returns the root folder for the model directories.

Returns

Definition at line 146 of file FileModelManager.java.

boolean jarmos.io.FileModelManager.modelFileExists ( String  filename)
virtual
See Also
jarmos.io.AModelManager::modelFileExists(java.lang.String)

Implements jarmos.io.AModelManager.

Definition at line 86 of file FileModelManager.java.

void jarmos.io.FileModelManager.writeModelFile ( String  filename,
InputStream  in 
) throws IOException

Writes the given inputstream to the file specified by filename to the current model directory.

Parameters
filenameThe file name
inThe inputstream to read
Exceptions
IOException

Definition at line 103 of file FileModelManager.java.

Member Data Documentation

final String jarmos.io.FileModelManager.MODEL_DIR = "/home/dwirtz/aghhome/Software/Eclipse/JaRMoS/JaRMoSModels"
static

Definition at line 26 of file FileModelManager.java.


The documentation for this class was generated from the following file: