ix.test
Class CompendiumToIX

java.lang.Object
  extended by ix.test.CompendiumToIX

public class CompendiumToIX
extends java.lang.Object

Converts a Compendium map expressed in Compendium's XML syntax to an I-X plan in I-X XML syntax.

See Also:
main(String[])

Nested Class Summary
(package private)  class CompendiumToIX.Link
          A simple representation of Compendium links.
 
Field Summary
(package private)  java.util.List activities
           
(package private) static int ARGUMENT
          Compendium node type
(package private) static int ARGUMENT_SHORTCUT
          Compendium node type
(package private)  PlanBuilder builder
           
(package private)  java.util.Map CompendiumIdToIXObjectMap
           
(package private) static int CON
          Compendium node type
(package private) static int CON_SHORTCUT
          Compendium node type
(package private)  java.util.List constraints
           
(package private) static int DECISION
          Compendium node type
(package private) static int DECISION_SHORTCUT
          Compendium node type
(package private) static int ISSUE
          Compendium node type
(package private) static int ISSUE_SHORTCUT
          Compendium node type
(package private)  java.util.List issues
           
(package private) static java.lang.String K_ID
          Annotation key
(package private) static java.lang.String K_LABEL
          Annotation key
(package private) static java.lang.String K_LINKS
          Annotation key
(package private)  MultiMap linkMap
           
(package private) static int LIST
          Compendium node type
(package private) static int LIST_SHORTCUT
          Compendium node type
(package private) static int MAP
          Compendium node type
(package private) static int MAP_SHORTCUT
          Compendium node type
(package private) static int NOTE
          Compendium node type
(package private) static int NOTE_SHORTCUT
          Compendium node type
(package private) static int POSITION
          Compendium node type
(package private) static int POSITION_SHORTCUT
          Compendium node type
(package private) static int PRO
          Compendium node type
(package private) static int PRO_SHORTCUT
          Compendium node type
(package private) static int REFERENCE
          Compendium node type
(package private) static int REFERENCE_SHORTCUT
          Compendium node type
 
Constructor Summary
CompendiumToIX()
           
 
Method Summary
(package private)  void addActivityToPlan(Activity activity)
          Adds an activity as a subactivity of its parent activity, if it has one, else as a top-level activity.
(package private)  void addConstraintToPlan(Constraint con)
          Adds a top-level constraint.
(package private)  void addIssueToPlan(Issue issue)
          Adds an issue as a subissue of its parent issue, if it has one, else as a top-level issue.
(package private)  void addLinksAnnotation(IXObject item, IXObject parent)
          Gives the item an annotation with key K_LINKS and value a list of link descriptions.
(package private)  void addNodeAnnotations(IXObject item, org.jdom.Element elt)
          Give the IXObject any "standard" annotations derived from the Compendium node.
(package private)  IXObject findParent(IXObject item)
          Returns the item's parent, if it has one; otherwise, returns null.
(package private)  java.lang.String getCompendiumId(org.jdom.Element elt)
          Returns the value of an Element's "id" attribute.
(package private)  int getCompendiumType(org.jdom.Element elt)
          Returns the Compenium type as an int, or an int < 0 if that type cannot be determined.
(package private)  java.util.List getLinks(IXObject from)
          Returns the list of CompendiumToIX.Links that go from the specified IXObject.
(package private)  IXObject IXObjectForId(java.lang.String id)
          Returns the I-X object made from the Compendium node with the given id.
static void main(java.lang.String[] argv)
           
(package private)  Activity makeIXActivity(org.jdom.Element elt)
           
(package private)  Constraint makeIXConstraint(org.jdom.Element elt)
           
(package private)  Issue makeIXIssue(org.jdom.Element elt)
           
(package private)  java.lang.Object makeIXObject(org.jdom.Element elt)
          Converts Compendium Elements to I-X objects and adds the I-X objects to any relevant accumulating lists.
(package private)  java.util.List objectsLinkedFrom(IXObject from)
           
(package private)  java.util.List objectsLinkedFrom(IXObject from, java.lang.Class filterCondition)
           
(package private)  LList patternFromCompendiumNode(org.jdom.Element elt)
           
(package private)  LList patternFromText(java.lang.String text)
          Converts text taken from a Compendium label to an I-X pattern.
(package private)  void phaseOne(org.jdom.Document doc)
          Phase 1 -- convert from Compendium XML to I-X objects.
(package private)  void phaseTwo()
          Phase 2 -- build the plan
 org.jdom.Document transform(org.jdom.Document doc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIST

static final int LIST
Compendium node type

See Also:
Constant Field Values

MAP

static final int MAP
Compendium node type

See Also:
Constant Field Values

ISSUE

static final int ISSUE
Compendium node type

See Also:
Constant Field Values

POSITION

static final int POSITION
Compendium node type

See Also:
Constant Field Values

ARGUMENT

static final int ARGUMENT
Compendium node type

See Also:
Constant Field Values

PRO

static final int PRO
Compendium node type

See Also:
Constant Field Values

CON

static final int CON
Compendium node type

See Also:
Constant Field Values

DECISION

static final int DECISION
Compendium node type

See Also:
Constant Field Values

REFERENCE

static final int REFERENCE
Compendium node type

See Also:
Constant Field Values

NOTE

static final int NOTE
Compendium node type

See Also:
Constant Field Values

LIST_SHORTCUT

static final int LIST_SHORTCUT
Compendium node type

See Also:
Constant Field Values

MAP_SHORTCUT

static final int MAP_SHORTCUT
Compendium node type

See Also:
Constant Field Values

ISSUE_SHORTCUT

static final int ISSUE_SHORTCUT
Compendium node type

See Also:
Constant Field Values

POSITION_SHORTCUT

static final int POSITION_SHORTCUT
Compendium node type

See Also:
Constant Field Values

ARGUMENT_SHORTCUT

static final int ARGUMENT_SHORTCUT
Compendium node type

See Also:
Constant Field Values

PRO_SHORTCUT

static final int PRO_SHORTCUT
Compendium node type

See Also:
Constant Field Values

CON_SHORTCUT

static final int CON_SHORTCUT
Compendium node type

See Also:
Constant Field Values

DECISION_SHORTCUT

static final int DECISION_SHORTCUT
Compendium node type

See Also:
Constant Field Values

REFERENCE_SHORTCUT

static final int REFERENCE_SHORTCUT
Compendium node type

See Also:
Constant Field Values

NOTE_SHORTCUT

static final int NOTE_SHORTCUT
Compendium node type

See Also:
Constant Field Values

K_ID

static final java.lang.String K_ID
Annotation key

See Also:
Constant Field Values

K_LABEL

static final java.lang.String K_LABEL
Annotation key

See Also:
Constant Field Values

K_LINKS

static final java.lang.String K_LINKS
Annotation key

See Also:
Constant Field Values

builder

PlanBuilder builder

CompendiumIdToIXObjectMap

java.util.Map CompendiumIdToIXObjectMap

linkMap

MultiMap linkMap

issues

java.util.List issues

activities

java.util.List activities

constraints

java.util.List constraints
Constructor Detail

CompendiumToIX

public CompendiumToIX()
Method Detail

transform

public org.jdom.Document transform(org.jdom.Document doc)

phaseOne

void phaseOne(org.jdom.Document doc)
Phase 1 -- convert from Compendium XML to I-X objects.


makeIXObject

java.lang.Object makeIXObject(org.jdom.Element elt)
Converts Compendium Elements to I-X objects and adds the I-X objects to any relevant accumulating lists. Returns null if there is no known conversion.


makeIXIssue

Issue makeIXIssue(org.jdom.Element elt)

makeIXActivity

Activity makeIXActivity(org.jdom.Element elt)

makeIXConstraint

Constraint makeIXConstraint(org.jdom.Element elt)

patternFromCompendiumNode

LList patternFromCompendiumNode(org.jdom.Element elt)

patternFromText

LList patternFromText(java.lang.String text)
Converts text taken from a Compendium label to an I-X pattern.


addNodeAnnotations

void addNodeAnnotations(IXObject item,
                        org.jdom.Element elt)
Give the IXObject any "standard" annotations derived from the Compendium node. At present, this just records the Compendium id under the key K_ID.


getCompendiumType

int getCompendiumType(org.jdom.Element elt)
Returns the Compenium type as an int, or an int < 0 if that type cannot be determined.


getCompendiumId

java.lang.String getCompendiumId(org.jdom.Element elt)
Returns the value of an Element's "id" attribute.


phaseTwo

void phaseTwo()
Phase 2 -- build the plan


addIssueToPlan

void addIssueToPlan(Issue issue)
Adds an issue as a subissue of its parent issue, if it has one, else as a top-level issue.

See Also:
findParent(IXObject)

addActivityToPlan

void addActivityToPlan(Activity activity)
Adds an activity as a subactivity of its parent activity, if it has one, else as a top-level activity.

See Also:
findParent(IXObject)

addConstraintToPlan

void addConstraintToPlan(Constraint con)
Adds a top-level constraint.


findParent

IXObject findParent(IXObject item)
Returns the item's parent, if it has one; otherwise, returns null. The first linked-to object of the same class as the item is taken as the parent.


addLinksAnnotation

void addLinksAnnotation(IXObject item,
                        IXObject parent)
Gives the item an annotation with key K_LINKS and value a list of link descriptions.


IXObjectForId

IXObject IXObjectForId(java.lang.String id)
Returns the I-X object made from the Compendium node with the given id.


getLinks

java.util.List getLinks(IXObject from)
Returns the list of CompendiumToIX.Links that go from the specified IXObject. Always returns a List, never null.


objectsLinkedFrom

java.util.List objectsLinkedFrom(IXObject from)

objectsLinkedFrom

java.util.List objectsLinkedFrom(IXObject from,
                                 java.lang.Class filterCondition)

main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
Throws:
java.lang.Exception