wt.part
Class MultilevelBomCompareVisitor

java.lang.Object
  extended bywt.part.MultilevelBomCompareVisitor
All Implemented Interfaces:
Serializable

public class MultilevelBomCompareVisitor
extends Object
implements Serializable

This visitor is used to write XML data for the Multilevel BOM Compare report using a DocumentHandler.

Supported API: true

Extendable: true

See Also:
Serialized Form

Field Summary
private static String AMOUNT
           
private static String BASELINE_NAME
           
private static String CDATA
           
private static String CLASSNAME
           
private static String COMPARISON_NODE
           
private static String CONFIGURATION_ITEM_NAME
           
private static String DISPLAY_NAME
           
private static String EFFECTIVITY_DATE
           
private static String EFFECTIVITY_TYPE
           
private static String ENCODING
           
private static String ERROR
           
private  boolean identicalProductMastersAreSame
           
private static String INCORPORATION_DATE
           
private static String IS_PLANNING_DATE
           
private static String ITERATION
           
private  Hashtable matchingHashtable
           
private  Stack matchingHashtableStack
           
private  DocumentHandler myDocumentHandler
           
private  Locale myLocale
           
private static String NAME
           
private static String NUMBER
           
private static String OID
           
private static String PART_FRAGMENT
           
private static String PART_MASTER
           
private static String PART_VERSION_FRAGMENT
           
private  Stack pendingElementEndStack
           
private  Stack pendingElementStartStack
           
private static String QUANTITY
           
private  DecimalFormat quantityFormat
           
private static String RESOURCE
           
private static String SERIAL_NUMBER
           
private static String SPEC_FRAGMENT
           
private static String STATE
           
private static String TYPE
           
private static String UNIT
           
private static boolean VERBOSE
           
private static String VERSION
           
private static String VIEW
           
private  Hashtable visitedHashtable
           
private static String WORKING_INCLUDED
           
 
Constructor Summary
MultilevelBomCompareVisitor(DocumentHandler aDocumentHandler, Locale aLocale)
          

Supported API: false
 
Method Summary
 void addToCache(Persistable[] partLink)
          

Supported API: true
 boolean areSame(Persistable[] link1, Persistable[] link2)
          If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.
 boolean areSame(WTPartUsageLink link1, WTPartUsageLink link2)
           
 boolean areSamePart(Persistable object1, Persistable object2)
           
 boolean cacheIsEmpty()
          

Supported API: false
 void completeVisit(Persistable[] link1, Persistable[] link2)
          If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.
 void endComparisonNodeElement(Persistable[] link1, Persistable[] link2)
          If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.
 void endLevel()
          

Supported API: true
 void endPartElement(WTPart part, int index)
          If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.
 void endPartMasterElement(Persistable[] link1, Persistable[] link2)
          If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.
 void endPartMasterElement(WTPartMaster partMaster, int index)
          If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.
 void endPartVersionElement(Persistable[] link, int index)
          If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.
 void endSpecElement(ConfigSpec spec, int index)
           
 void endSpecElement(WTPartConfigSpec spec, int index)
          If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.
(package private)  boolean getIdenticalProductMastersAreSame()
           
private  QueryKey getKey(Persistable[] partLink)
           
 boolean hasPath(WTPartUsageLink usageLink)
           
 boolean haveCompatiblePaths(Persistable[] link1, Persistable[] link2)
           
 boolean havePaths(Persistable[] link1, Persistable[] link2)
           
 boolean lookDeeper(WTPart part1, WTPart part2)
          Checks to see if we should look deeper for differences.
 Persistable[] matchToCache(Persistable[] partLink)
          Looks in the hash table for the part that matches the part passed in as an agrument.
 void output(String purpose, Persistable[] link)
           
 void postponeComparisonNodeElement(Persistable[] link1, Persistable[] link2)
          If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.
 Enumeration removeFromCache()
          

Supported API: false
 void removeFromCache(Persistable[] link)
          

Supported API: false
(package private)  void setIdenticalProductMastersAreSame(boolean identicalProductMastersAreSame)
           
 void startComparisonNodeElement(Persistable[] link1, Persistable[] link2)
          If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.
 void startLevel()
          

Supported API: true
 void startPartElement(WTPart part, int index)
          If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.
 void startPartElement(WTProductConfiguration configuration, int index)
           
 void startPartElement(WTProductInstance2 instance, int index)
           
 void startPartMasterElement(Persistable[] link1, Persistable[] link2)
          If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.
 void startPartMasterElement(WTPartMaster partMaster, int index)
          Output the XML tag for a part master.
 void startPartVersionElement(Persistable[] link, int index)
          If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.
 void startSpecElement(ConfigSpec spec, int index)
           
 void startSpecElement(WTPartConfigSpec spec, int index)
          If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.
 void visit(Persistable[] link1, Persistable[] link2)
          If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.
 void visitCompatiblePaths(Persistable[] link1, Persistable[] link2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

matchingHashtableStack

private Stack matchingHashtableStack

visitedHashtable

private Hashtable visitedHashtable

matchingHashtable

private Hashtable matchingHashtable

pendingElementStartStack

private Stack pendingElementStartStack

pendingElementEndStack

private Stack pendingElementEndStack

myDocumentHandler

private DocumentHandler myDocumentHandler

myLocale

private Locale myLocale

AMOUNT

private static final String AMOUNT
See Also:
Constant Field Values

BASELINE_NAME

private static final String BASELINE_NAME
See Also:
Constant Field Values

CDATA

private static final String CDATA
See Also:
Constant Field Values

COMPARISON_NODE

private static final String COMPARISON_NODE
See Also:
Constant Field Values

CONFIGURATION_ITEM_NAME

private static final String CONFIGURATION_ITEM_NAME
See Also:
Constant Field Values

DISPLAY_NAME

private static final String DISPLAY_NAME
See Also:
Constant Field Values

EFFECTIVITY_DATE

private static final String EFFECTIVITY_DATE
See Also:
Constant Field Values

EFFECTIVITY_TYPE

private static final String EFFECTIVITY_TYPE
See Also:
Constant Field Values

ENCODING

private static final String ENCODING
See Also:
Constant Field Values

ERROR

private static final String ERROR
See Also:
Constant Field Values

INCORPORATION_DATE

private static final String INCORPORATION_DATE
See Also:
Constant Field Values

IS_PLANNING_DATE

private static final String IS_PLANNING_DATE
See Also:
Constant Field Values

ITERATION

private static final String ITERATION
See Also:
Constant Field Values

NAME

private static final String NAME
See Also:
Constant Field Values

NUMBER

private static final String NUMBER
See Also:
Constant Field Values

OID

private static final String OID
See Also:
Constant Field Values

PART_FRAGMENT

private static final String PART_FRAGMENT
See Also:
Constant Field Values

PART_MASTER

private static final String PART_MASTER
See Also:
Constant Field Values

PART_VERSION_FRAGMENT

private static final String PART_VERSION_FRAGMENT
See Also:
Constant Field Values

QUANTITY

private static final String QUANTITY
See Also:
Constant Field Values

SERIAL_NUMBER

private static final String SERIAL_NUMBER
See Also:
Constant Field Values

SPEC_FRAGMENT

private static final String SPEC_FRAGMENT
See Also:
Constant Field Values

STATE

private static final String STATE
See Also:
Constant Field Values

TYPE

private static final String TYPE
See Also:
Constant Field Values

UNIT

private static final String UNIT
See Also:
Constant Field Values

VERSION

private static final String VERSION
See Also:
Constant Field Values

VIEW

private static final String VIEW
See Also:
Constant Field Values

WORKING_INCLUDED

private static final String WORKING_INCLUDED
See Also:
Constant Field Values

VERBOSE

private static final boolean VERBOSE
See Also:
Constant Field Values

quantityFormat

private DecimalFormat quantityFormat

identicalProductMastersAreSame

private boolean identicalProductMastersAreSame
Constructor Detail

MultilevelBomCompareVisitor

public MultilevelBomCompareVisitor(DocumentHandler aDocumentHandler,
                                   Locale aLocale)


Supported API: false

Parameters:
aDocumentHandler -
aLocale -
Method Detail

lookDeeper

public boolean lookDeeper(WTPart part1,
                          WTPart part2)
Checks to see if we should look deeper for differences. returns true if the two parts have the same part master.

Supported API: false

Parameters:
part1 -
part2 -
Returns:
boolean
See Also:
WTPartMaster

matchToCache

public Persistable[] matchToCache(Persistable[] partLink)
Looks in the hash table for the part that matches the part passed in as an agrument.

Supported API: false

Parameters:
partLink -
Returns:
Persistable[]

visit

public void visit(Persistable[] link1,
                  Persistable[] link2)
           throws SAXException,
                  WTException
If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.

Supported API: false

Parameters:
link1 -
link2 -
Throws:
SAXException
WTException

addToCache

public void addToCache(Persistable[] partLink)


Supported API: true

Parameters:
partLink -

startLevel

public void startLevel()


Supported API: true


removeFromCache

public void removeFromCache(Persistable[] link)


Supported API: false

Parameters:
link -

removeFromCache

public Enumeration removeFromCache()


Supported API: false

Returns:
Enumeration

cacheIsEmpty

public boolean cacheIsEmpty()


Supported API: false

Returns:
boolean

endLevel

public void endLevel()


Supported API: true


completeVisit

public void completeVisit(Persistable[] link1,
                          Persistable[] link2)
                   throws SAXException
If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.

Supported API: false

Parameters:
link1 -
link2 -
Throws:
SAXException

startComparisonNodeElement

public void startComparisonNodeElement(Persistable[] link1,
                                       Persistable[] link2)
                                throws SAXException,
                                       WTException
If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.

Supported API: false

Parameters:
link1 -
link2 -
Throws:
SAXException
WTException

endComparisonNodeElement

public void endComparisonNodeElement(Persistable[] link1,
                                     Persistable[] link2)
                              throws SAXException
If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.

Supported API: false

Parameters:
link1 -
link2 -
Throws:
SAXException

postponeComparisonNodeElement

public void postponeComparisonNodeElement(Persistable[] link1,
                                          Persistable[] link2)
If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.

Supported API: false

Parameters:
link1 -
link2 -

areSame

public boolean areSame(Persistable[] link1,
                       Persistable[] link2)
If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.

Supported API: false

Parameters:
link1 -
link2 -
Returns:
boolean

startPartMasterElement

public void startPartMasterElement(Persistable[] link1,
                                   Persistable[] link2)
                            throws SAXException
If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.

Supported API: false

Parameters:
link1 -
link2 -
Throws:
SAXException

endPartMasterElement

public void endPartMasterElement(Persistable[] link1,
                                 Persistable[] link2)
                          throws SAXException
If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.

Supported API: false

Parameters:
link1 -
link2 -
Throws:
SAXException

startPartVersionElement

public void startPartVersionElement(Persistable[] link,
                                    int index)
                             throws SAXException,
                                    WTException
If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.

Supported API: false

Parameters:
link -
index -
Throws:
SAXException
WTException

endPartVersionElement

public void endPartVersionElement(Persistable[] link,
                                  int index)
                           throws SAXException
If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.

Supported API: false

Parameters:
link -
index -
Throws:
SAXException

startPartElement

public void startPartElement(WTPart part,
                             int index)
                      throws SAXException,
                             WTException
If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.

Supported API: false

Parameters:
part -
index -
Throws:
SAXException
WTException

endPartElement

public void endPartElement(WTPart part,
                           int index)
                    throws SAXException
If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.

Supported API: false

Parameters:
part -
index -
Throws:
SAXException

startSpecElement

public void startSpecElement(WTPartConfigSpec spec,
                             int index)
                      throws SAXException
If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.

Supported API: false

Parameters:
spec -
index -
Throws:
SAXException

endSpecElement

public void endSpecElement(WTPartConfigSpec spec,
                           int index)
                    throws SAXException
If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.

Supported API: false

Parameters:
spec -
index -
Throws:
SAXException

startPartMasterElement

public void startPartMasterElement(WTPartMaster partMaster,
                                   int index)
                            throws SAXException,
                                   WTException
Output the XML tag for a part master.

Supported API: false

Parameters:
partMaster -
index -
Throws:
SAXException
WTException

endPartMasterElement

public void endPartMasterElement(WTPartMaster partMaster,
                                 int index)
                          throws SAXException
If the two parts are different or the result of comparing their subparts is not empty, then output the XML for these two parts and their sub results.

Supported API: false

Parameters:
partMaster -
index -
Throws:
SAXException

getKey

private QueryKey getKey(Persistable[] partLink)

startPartElement

public void startPartElement(WTProductConfiguration configuration,
                             int index)
                      throws SAXException,
                             WTException
Throws:
SAXException
WTException

startPartElement

public void startPartElement(WTProductInstance2 instance,
                             int index)
                      throws SAXException,
                             WTException
Throws:
SAXException
WTException

output

public void output(String purpose,
                   Persistable[] link)

havePaths

public boolean havePaths(Persistable[] link1,
                         Persistable[] link2)

haveCompatiblePaths

public boolean haveCompatiblePaths(Persistable[] link1,
                                   Persistable[] link2)

visitCompatiblePaths

public void visitCompatiblePaths(Persistable[] link1,
                                 Persistable[] link2)
                          throws SAXException,
                                 WTException
Throws:
SAXException
WTException

hasPath

public boolean hasPath(WTPartUsageLink usageLink)

areSame

public boolean areSame(WTPartUsageLink link1,
                       WTPartUsageLink link2)

areSamePart

public boolean areSamePart(Persistable object1,
                           Persistable object2)
                    throws WTException
Throws:
WTException

getIdenticalProductMastersAreSame

boolean getIdenticalProductMastersAreSame()

setIdenticalProductMastersAreSame

void setIdenticalProductMastersAreSame(boolean identicalProductMastersAreSame)

startSpecElement

public void startSpecElement(ConfigSpec spec,
                             int index)
                      throws SAXException
Throws:
SAXException

endSpecElement

public void endSpecElement(ConfigSpec spec,
                           int index)
                    throws SAXException
Throws:
SAXException