org.gridbus.broker.parsers
Class AbstractApplicationParser
java.lang.Object
org.gridbus.broker.parsers.AbstractApplicationParser
- All Implemented Interfaces:
- ApplicationParser
- Direct Known Subclasses:
- JsdlParser, XPMLParser
public abstract class AbstractApplicationParser
- extends java.lang.Object
- implements ApplicationParser
- Version:
- 1.0
AbstractApplicationParser is the base class for various parsers
- Author:
- Xingchen Chu (xchu@csse.unimelb.edu.au)
|
Method Summary |
java.lang.String |
getApplicationId()
get the current parsing application's id. |
protected abstract java.lang.Object |
getRootElement(org.apache.xmlbeans.XmlObject appDoc)
rootElement returns the root element of the given document |
protected abstract org.apache.xmlbeans.XmlObject |
parseDocument(java.lang.String appDescriptionFilename)
parseDocument accepts the xml description file and parse to related XmlObject
Subclasses can provide their own concrete type of the XmlObject |
void |
setApplicationId(java.lang.String applicationId)
|
void |
validate(java.lang.String filename)
Validates the given application description file with the schema, and returns true if it is valid |
protected void |
validate(org.apache.xmlbeans.XmlObject obj)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractApplicationParser
public AbstractApplicationParser()
validate
protected void validate(org.apache.xmlbeans.XmlObject obj)
throws java.lang.Exception
- Throws:
java.lang.Exception
validate
public void validate(java.lang.String filename)
throws java.lang.Exception
- Validates the given application description file with the schema, and returns true if it is valid
- Specified by:
validate in interface ApplicationParser
- Parameters:
filename -
- Throws:
java.lang.Exception
parseDocument
protected abstract org.apache.xmlbeans.XmlObject parseDocument(java.lang.String appDescriptionFilename)
throws java.lang.Exception
parseDocument accepts the xml description file and parse to related XmlObject
Subclasses can provide their own concrete type of the XmlObject
- Parameters:
appDescriptionFilename -
- Returns:
- XmlObject that can be validated
- Throws:
java.lang.Exception
getRootElement
protected abstract java.lang.Object getRootElement(org.apache.xmlbeans.XmlObject appDoc)
throws java.lang.Exception
rootElement returns the root element of the given document
- Parameters:
appDoc -
- Returns:
- the root element of the given document
- Throws:
java.lang.Exception
getApplicationId
public java.lang.String getApplicationId()
throws java.lang.Exception
- Description copied from interface:
ApplicationParser
- get the current parsing application's id.
- Specified by:
getApplicationId in interface ApplicationParser
- Returns:
-
- Throws:
java.lang.Exception- See Also:
ApplicationParser.getApplicationId()
setApplicationId
public void setApplicationId(java.lang.String applicationId)
throws java.lang.Exception
- Specified by:
setApplicationId in interface ApplicationParser
- Throws:
java.lang.Exception- See Also:
ApplicationParser.setApplicationId(java.lang.String)