|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.magicproject.xml.XmlTbs
public final class XmlTbs
This is the main class used to convert a turn based system described in a XML form to a binary form for further interpretation.
Field Summary | |
---|---|
static ReferencePager |
cardPager
The card reference pager. |
static int |
currentActionIndex
Nb written action in the current 'writeActionlist' method. |
static boolean |
currentInEffect
Is the last action has benn written in effects part of ability? |
static java.util.Map<java.lang.String,XmlParser.Node> |
referencedAbilities
Available ability references of this Card. |
static java.util.Map<java.lang.String,java.util.List<XmlParser.Node>> |
referencedActions
Available actions references of this Card. |
static java.util.Set<java.lang.String> |
referencedNonMacroActions
Available actions references that do not accept macro. |
static java.util.Map<java.lang.String,XmlParser.Node> |
referencedTest
Available test references of this Card. |
Method Summary | |
---|---|
static XmlParser.Node |
getReferencedAbility(java.lang.String abilityName)
Returns the referenced ability. |
static java.util.List<XmlParser.Node> |
getReferencedActions(java.lang.String actionName)
Returns the referenced action(s). |
static XmlParser.Node |
getReferencedAttachment(java.lang.String attachmentName)
Returns the referenced attachment declared within the rules definition. |
static XmlParser.Node |
getReferencedTest(java.lang.String testName)
Returns the referenced test. |
static XmlToMDB |
getTbsComponent(java.lang.String component)
Returns a suitable XmlToMDB implementation for the given tbs component name. |
static boolean |
isNotMacro(java.lang.String referenceName)
Indicates if the specified referenced action accept macro or not. |
static void |
updateMdb(java.lang.String mdbName,
java.io.OutputStream out)
Reads from the tbs directory the existing XML files, parse them, add them to the mdb file in the right order |
static int |
writeActionList(XmlParser.Node node,
java.io.OutputStream out0)
Writes a list of actions described in the given XML node to the given OutputStream (which must be a FileOutputStream) prefixing the stream with an integer containing the number of written actions and returns this number of written actions. |
static int |
writeActionListNoNb(XmlParser.Node node,
java.io.OutputStream out)
Writes a list of actions described in the given XML node into the given OutputStream as a sequence and returns the number of written actions. |
static void |
writeCard(java.lang.String currentDir,
java.io.OutputStream out,
java.lang.String cardFile)
Writes the card identified by the given card XML description file name in the given directory to the given OutputStream. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.util.Map<java.lang.String,XmlParser.Node> referencedAbilities
public static java.util.Map<java.lang.String,XmlParser.Node> referencedTest
public static java.util.Map<java.lang.String,java.util.List<XmlParser.Node>> referencedActions
public static java.util.Set<java.lang.String> referencedNonMacroActions
public static int currentActionIndex
public static boolean currentInEffect
public static ReferencePager cardPager
Method Detail |
---|
public static int writeActionList(XmlParser.Node node, java.io.OutputStream out0) throws java.io.IOException
node
- the node containing list of actionsout0
- the OutputStream to write the given actions to
java.io.IOException
- if an I/O error occurs if an illegal access error occurs if a
security error occurs if an illegal argument is givenpublic static int writeActionListNoNb(XmlParser.Node node, java.io.OutputStream out) throws java.io.IOException
node
- the node containing list of actionsout
- the OutputStream to write the actions to
java.io.IOException
- if an I/O error occurs if an illegal access error occurs if a
security error occurs if an illegal argument is givenpublic static void writeCard(java.lang.String currentDir, java.io.OutputStream out, java.lang.String cardFile)
currentDir
- the directory path to find the card XML description file nameout
- the OutputStream to write the identified card tocardFile
- the card XML description file namepublic static void updateMdb(java.lang.String mdbName, java.io.OutputStream out) throws java.io.IOException
mdbName
- the mdb name used to find the directory containing the XML files.out
- the outputStream where the cards would written in.
java.io.IOException
public static XmlToMDB getTbsComponent(java.lang.String component)
component
- the name of the tbs component
public static XmlParser.Node getReferencedAbility(java.lang.String abilityName)
abilityName
- the ability name
public static XmlParser.Node getReferencedAttachment(java.lang.String attachmentName)
attachmentName
- the attachment name
public static java.util.List<XmlParser.Node> getReferencedActions(java.lang.String actionName)
actionName
- the action name
public static boolean isNotMacro(java.lang.String referenceName)
referenceName
- the referenced action name
public static XmlParser.Node getReferencedTest(java.lang.String testName)
testName
- the test name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |