|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hdcookbook.grin.io.text.ExtensionParserList
public class ExtensionParserList
A list of extension parsers. Often, extensions are composed together in one project. When this is the case, it's useful to be able to string together a number of extension parsers.
ExtensionParser
Constructor Summary | |
---|---|
ExtensionParserList()
Create a new ExtensionParserList with no parsers in it. |
Method Summary | |
---|---|
void |
addParser(ExtensionParser parser)
Add the supplied parser to the list of parsers. |
Command |
getCommand(Show show,
java.lang.String typeName,
Lexer lexer)
Get a modifier command of the given type. |
Feature |
getFeature(Show show,
java.lang.String typeName,
java.lang.String name,
Lexer lexer)
Get a feature of the given type. |
Modifier |
getModifier(Show show,
java.lang.String typeName,
java.lang.String name,
Lexer lexer)
Get a modifier feature of the given type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExtensionParserList()
addParser(ExtensionParser)
Method Detail |
---|
public void addParser(ExtensionParser parser)
public Feature getFeature(Show show, java.lang.String typeName, java.lang.String name, Lexer lexer) throws java.io.IOException
"feature" "modifier" namespace:type_name name feature_name arguments ";"This method gets a Lexer instance that is pointed to the beginning of the arguments. The implementation of this method is expected to return an instance of a feature which loads on a standard JDK. It can be different from the feature class that is going to be used with the xlet in the BD-J environment.
getFeature
in interface ExtensionParser
show
- The show being parsedtypeName
- The name of the feature's type. This will always
contain a ":".name
- The name of this instance of feature
a list of commands if needed.lexer
- The lexer to parse arguments for this feature.
The implementation of this method should parse up to ";"
which indicates the end of the feature declaration.
java.io.IOException
- if there's an error.public Modifier getModifier(Show show, java.lang.String typeName, java.lang.String name, Lexer lexer) throws java.io.IOException
The syntax of an extension feature is fixed at
"feature" "modifier" namespace:type_name name feature_name arguments ";"where feature_name is given iff the feature is a Modifier. This method gets a Lexer instance that is pointed to the beginning of the arguments. The implementation of this method is expected to return an instance of a modifier which loads on a standard JDK. It can be different from the modifier class that is going to be used with the xlet in the BD-J environment.
getModifier
in interface ExtensionParser
show
- The show being parsedtypeName
- The name of the feature's type. This will always
contain a ":".name
- The name of this instance of feature
a list of commands if needed.lexer
- The lexer to parse arguments for this feature.
The implementation of this method should parse up to ";"
which indicates the end of the feature declaration.
java.io.IOException
- if there's an error.public Command getCommand(Show show, java.lang.String typeName, Lexer lexer) throws java.io.IOException
getCommand
in interface ExtensionParser
show
- The show being parsedtypeName
- The name of the commands's type. This will always
contain a ":".lexer
- The lexer to parse arguments for this feature.
The implementation of this method should parse up to ";"
which indicates the end of the feature declaration.
java.io.IOException
- if there's an error.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |