Jadex 0.96-beta1

jadex.model
Class SXML

java.lang.Object
  extended by jadex.model.SXML

public class SXML
extends Object

This class contains static xml helper methods.


Field Summary
static String FACTORY_JIBX
          The jibx factory name.
static String FILE_EXTENSION_AGENT
          The Jadex agent extension.
static String FILE_EXTENSION_CAPABILITY
          The Jadex capability extension.
static String FILE_EXTENSION_PROPERTIES
          The Jadex properties extension.
static IModelLoader loader
          The loader factory.
 
Constructor Summary
SXML()
           
 
Method Summary
static void clearModelCache(String filename)
          Clear the model cache.
static IModelLoader getFactory()
          Get the factory name.
static String getFactoryName()
          Get the factory name.
static ResourceInfo getResourceInfo(String xml, String suffix, String[] imports)
          Load an xml Jadex model.
static String getShortName(String filename)
          Strip the short type name from a model filename.
static boolean isAgentFilename(String filename)
          Test if a file is an agent file.
static boolean isCapabilityFilename(String filename)
          Test if a file is a capability file.
static boolean isJadexFilename(String filename)
          Test if a file is a Jadex file.
static boolean isPropertiesFilename(String filename)
          Test if a file is a properties file.
static IMBDIAgent loadAgentModel(String xml, String[] imports)
          Load an xml agent model.
static IMCapability loadCapabilityModel(String xml, String[] imports, IMElement owner)
          Load an xml capability model.
static IMElement loadModel(String xml, String xslt)
          Loads any xml Jadex model (e.g. agent or capability).
static IMPropertybase loadPropertiesModel(String xml, String[] imports, IMElement owner)
          Load an xml agent model.
static void persistModelCache()
          Persist the model cache.
static void setFactory(String name)
          Load a model loader.
static String stripJadexExtension(String filename)
          Strip Jadex filename extension.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FACTORY_JIBX

public static final String FACTORY_JIBX
The jibx factory name.

See Also:
Constant Field Values

FILE_EXTENSION_AGENT

public static final String FILE_EXTENSION_AGENT
The Jadex agent extension.

See Also:
Constant Field Values

FILE_EXTENSION_CAPABILITY

public static final String FILE_EXTENSION_CAPABILITY
The Jadex capability extension.

See Also:
Constant Field Values

FILE_EXTENSION_PROPERTIES

public static final String FILE_EXTENSION_PROPERTIES
The Jadex properties extension.

See Also:
Constant Field Values

loader

public static IModelLoader loader
The loader factory.

Constructor Detail

SXML

public SXML()
Method Detail

setFactory

public static void setFactory(String name)
Load a model loader.

Parameters:
name - The loader name.

getFactory

public static IModelLoader getFactory()
Get the factory name.

Returns:
The factory name.

getFactoryName

public static String getFactoryName()
Get the factory name.

Returns:
The factory name.

loadAgentModel

public static IMBDIAgent loadAgentModel(String xml,
                                        String[] imports)
                                 throws IOException
Load an xml agent model. Creates file name when specified as package (eg jadex.examples.Helloworld is converted to jadex/examples/Helloworld.agent.xml).

Returns:
The loaded agent model.
Throws:
IOException

loadCapabilityModel

public static IMCapability loadCapabilityModel(String xml,
                                               String[] imports,
                                               IMElement owner)
                                        throws IOException
Load an xml capability model. (eg jadex.planlib.DF is converted to jadex/planlib/DF.capability.xml).

Returns:
The loaded capability model.
Throws:
IOException

loadPropertiesModel

public static IMPropertybase loadPropertiesModel(String xml,
                                                 String[] imports,
                                                 IMElement owner)
                                          throws IOException
Load an xml agent model. Creates file name when specified as package (eg jadex.config.Runtime is converted to jadex/config/runtime.properties.xml).

Returns:
The loaded property base model.
Throws:
IOException

loadModel

public static IMElement loadModel(String xml,
                                  String xslt)
                           throws IOException
Loads any xml Jadex model (e.g. agent or capability). Applies the XSLT template to the resource before parsing it. Used from Jadexdoc to move comments into the description attributes.

Returns:
The loaded model.
Throws:
IOException

clearModelCache

public static void clearModelCache(String filename)
Clear the model cache. Needed for being able to reload models.


persistModelCache

public static void persistModelCache()
                              throws IOException
Persist the model cache. Needed for being able to reload models.

Throws:
IOException

getResourceInfo

public static ResourceInfo getResourceInfo(String xml,
                                           String suffix,
                                           String[] imports)
                                    throws IOException
Load an xml Jadex model. Creates file name when specified with or without package. Transforms the model via the Jadex default xslt when not null. Configures the model via setup() when configurable.

Parameters:
xml - The filename | fully qualified classname
Returns:
The loaded model.
Throws:
IOException

isJadexFilename

public static boolean isJadexFilename(String filename)
Test if a file is a Jadex file.

Parameters:
filename - The filename.
Returns:
True, if it is a Jadex file.

isAgentFilename

public static boolean isAgentFilename(String filename)
Test if a file is an agent file.

Parameters:
filename - The filename.
Returns:
True, if it is an agent file.

isCapabilityFilename

public static boolean isCapabilityFilename(String filename)
Test if a file is a capability file.

Parameters:
filename - The filename.
Returns:
True, if it is a capability file.

isPropertiesFilename

public static boolean isPropertiesFilename(String filename)
Test if a file is a properties file.

Parameters:
filename - The filename.
Returns:
True, if it is a properties file.

stripJadexExtension

public static String stripJadexExtension(String filename)
Strip Jadex filename extension.

Parameters:
filename - The filename.
Returns:
The filename without extension.

getShortName

public static String getShortName(String filename)
Strip the short type name from a model filename.

Parameters:
filename - The filename.
Returns:
The short type name.

Jadex 0.96-beta1

Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples.

Copyright (C) 2002-2007 Lars Braubach, Alexander Pokahr - University of Hamburg. Use is subject to license terms.