TPTP 4.4.0 Platform Project
Public API Specification

org.eclipse.hyades.loaders.common
Class XMLexecutionEventLoader

java.lang.Object
  extended byorg.eclipse.hyades.loaders.hierarchy.IgnoredXMLFragmentLoader
      extended byorg.eclipse.hyades.loaders.common.XMLexecutionEventLoader
All Implemented Interfaces:
IXMLEventConstants, XMLFragmentLoader
Direct Known Subclasses:
XMLinvocationEventLoader, XMLloopEventLoader, XMLmessageEventLoader, XMLtimedEventLoader, XMLtypedEventLoader, XMLverdictEventLoader

public abstract class XMLexecutionEventLoader
extends IgnoredXMLFragmentLoader
implements IXMLEventConstants

This is the base class for the execution event loaders and handles attributes of the base event.


Field Summary
protected  CMNAnnotation annotation
           
protected  char[] annotationCDATA
           
protected  java.lang.String annotationFilename
           
protected  java.util.ArrayList annotations
           
protected  int conflict
           
static boolean DEBUG
           
protected  TPFExecutionEvent event
           
protected static java.lang.String EVENT_ANNOTATION
           
protected static java.lang.String EVENT_ANNOTATION_FILENAME
           
protected static java.lang.String EVENT_ANNOTATION_TYPE
           
protected static java.lang.String EVENT_CONFLICT
           
protected static java.lang.String EVENT_EVENT_TYPE
           
protected static java.lang.String EVENT_ID
           
protected static java.lang.String EVENT_NAME
           
protected static java.lang.String EVENT_OWNERID
           
protected static java.lang.String EVENT_PARENTID
           
protected static java.lang.String EVENT_PROPERTY
           
protected static java.lang.String EVENT_PROPERTY_NAME
           
protected static java.lang.String EVENT_PROPERTY_TYPE
           
protected static java.lang.String EVENT_PROPERTY_VALUE
           
protected static java.lang.String EVENT_REPOSITORY_RECORD
           
protected static java.lang.String EVENT_REPOSITORY_RECORD_ID
           
protected static java.lang.String EVENT_REPOSITORY_RECORD_LABEL
           
protected static java.lang.String EVENT_REPOSITORY_RECORD_TYPE
           
protected static java.lang.String EVENT_REPOSITORY_RECORD_URI
           
protected static java.lang.String EVENT_SORT_BY
           
protected static java.lang.String EVENT_TEXT
           
protected static java.lang.String EVENT_TIMESTAMP
           
protected  java.lang.String eventType
           
protected  java.lang.String id
           
protected static java.lang.Object ModelTraversalLock
           
protected  java.lang.String name
           
protected  java.lang.String ownerId
           
protected  java.lang.String parentId
           
protected  java.util.ArrayList properties
           
protected  CMNExtendedProperty property
           
protected  TPFRepositoryRecord repositoryRecord
           
protected  java.util.ArrayList repositoryRecords
           
static java.lang.String ROOT_PARENT
           
protected  java.lang.String sortBy
           
protected  java.lang.String text
           
protected  long timestamp
           
 
Fields inherited from class org.eclipse.hyades.loaders.hierarchy.IgnoredXMLFragmentLoader
context
 
Fields inherited from interface org.eclipse.hyades.loaders.common.IXMLEventConstants
CONFLICT_IGNORE, CONFLICT_NONE, CONFLICT_OVERWRITE, CONFLICT_OVERWRITE_IF_EARLIEST, CONFLICT_OVERWRITE_IF_LATEST
 
Constructor Summary
XMLexecutionEventLoader()
           
 
Method Summary
 void addAttribute(java.lang.String name, java.lang.String value)
           
 void addCharacters(char[] data, int offset, int length)
           
 void addYourselfInContext()
          This is called on end of root element of each fragment
 void addYourselfToContainer()
          This method adds the event to the correct container within the execution result.
 void endChild(java.lang.String name)
           
protected  TPFTest getReferencedTest()
           
 void initialize(HierarchyContext context, java.lang.String name)
          This is called on start of root element of each fragment
protected  boolean isIdentical(TPFExecutionEvent match)
          Check to see if there exists an event in the excution history that's identical to the current event being logged
protected  boolean needOverwrite(TPFExecutionEvent match)
          Based on the value of the 'conflict' attribute, figures out if an overwrite is required.
protected  void overwrite(TPFExecutionEvent match)
          Overwrite the properties of the basic TPFExecutionEvent
protected  void printAttribute(java.lang.String name, java.lang.String value)
           
protected  void printEndTag()
           
protected  void printTag(java.lang.String str)
           
protected  boolean resolveConflict(org.eclipse.emf.common.util.EList events)
          This method figures out if there is a conflict to resolve.
 void startChild(java.lang.String name)
           
 
Methods inherited from class org.eclipse.hyades.loaders.hierarchy.IgnoredXMLFragmentLoader
cleanUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static final boolean DEBUG
See Also:
Constant Field Values

ROOT_PARENT

public static final java.lang.String ROOT_PARENT
See Also:
Constant Field Values

EVENT_ID

protected static final java.lang.String EVENT_ID
See Also:
Constant Field Values

EVENT_OWNERID

protected static final java.lang.String EVENT_OWNERID
See Also:
Constant Field Values

EVENT_TIMESTAMP

protected static final java.lang.String EVENT_TIMESTAMP
See Also:
Constant Field Values

EVENT_TEXT

protected static final java.lang.String EVENT_TEXT
See Also:
Constant Field Values

EVENT_PARENTID

protected static final java.lang.String EVENT_PARENTID
See Also:
Constant Field Values

EVENT_NAME

protected static final java.lang.String EVENT_NAME
See Also:
Constant Field Values

EVENT_EVENT_TYPE

protected static final java.lang.String EVENT_EVENT_TYPE
See Also:
Constant Field Values

EVENT_SORT_BY

protected static final java.lang.String EVENT_SORT_BY
See Also:
Constant Field Values

EVENT_CONFLICT

protected static final java.lang.String EVENT_CONFLICT
See Also:
Constant Field Values

EVENT_PROPERTY

protected static final java.lang.String EVENT_PROPERTY
See Also:
Constant Field Values

EVENT_PROPERTY_NAME

protected static final java.lang.String EVENT_PROPERTY_NAME
See Also:
Constant Field Values

EVENT_PROPERTY_TYPE

protected static final java.lang.String EVENT_PROPERTY_TYPE
See Also:
Constant Field Values

EVENT_PROPERTY_VALUE

protected static final java.lang.String EVENT_PROPERTY_VALUE
See Also:
Constant Field Values

EVENT_ANNOTATION

protected static final java.lang.String EVENT_ANNOTATION
See Also:
Constant Field Values

EVENT_ANNOTATION_FILENAME

protected static final java.lang.String EVENT_ANNOTATION_FILENAME
See Also:
Constant Field Values

EVENT_ANNOTATION_TYPE

protected static final java.lang.String EVENT_ANNOTATION_TYPE
See Also:
Constant Field Values

EVENT_REPOSITORY_RECORD

protected static final java.lang.String EVENT_REPOSITORY_RECORD
See Also:
Constant Field Values

EVENT_REPOSITORY_RECORD_ID

protected static final java.lang.String EVENT_REPOSITORY_RECORD_ID
See Also:
Constant Field Values

EVENT_REPOSITORY_RECORD_URI

protected static final java.lang.String EVENT_REPOSITORY_RECORD_URI
See Also:
Constant Field Values

EVENT_REPOSITORY_RECORD_TYPE

protected static final java.lang.String EVENT_REPOSITORY_RECORD_TYPE
See Also:
Constant Field Values

EVENT_REPOSITORY_RECORD_LABEL

protected static final java.lang.String EVENT_REPOSITORY_RECORD_LABEL
See Also:
Constant Field Values

id

protected java.lang.String id

ownerId

protected java.lang.String ownerId

timestamp

protected long timestamp

text

protected java.lang.String text

event

protected TPFExecutionEvent event

parentId

protected java.lang.String parentId

name

protected java.lang.String name

eventType

protected java.lang.String eventType

sortBy

protected java.lang.String sortBy

conflict

protected int conflict

property

protected CMNExtendedProperty property

properties

protected java.util.ArrayList properties

annotation

protected CMNAnnotation annotation

annotationFilename

protected java.lang.String annotationFilename

annotationCDATA

protected char[] annotationCDATA

annotations

protected java.util.ArrayList annotations

repositoryRecords

protected java.util.ArrayList repositoryRecords

repositoryRecord

protected TPFRepositoryRecord repositoryRecord

ModelTraversalLock

protected static final java.lang.Object ModelTraversalLock
Constructor Detail

XMLexecutionEventLoader

public XMLexecutionEventLoader()
Method Detail

initialize

public void initialize(HierarchyContext context,
                       java.lang.String name)
Description copied from interface: XMLFragmentLoader
This is called on start of root element of each fragment

Specified by:
initialize in interface XMLFragmentLoader
Overrides:
initialize in class IgnoredXMLFragmentLoader

addAttribute

public void addAttribute(java.lang.String name,
                         java.lang.String value)
Specified by:
addAttribute in interface XMLFragmentLoader
Overrides:
addAttribute in class IgnoredXMLFragmentLoader

addCharacters

public void addCharacters(char[] data,
                          int offset,
                          int length)
Specified by:
addCharacters in interface XMLFragmentLoader
Overrides:
addCharacters in class IgnoredXMLFragmentLoader

startChild

public void startChild(java.lang.String name)
Specified by:
startChild in interface XMLFragmentLoader
Overrides:
startChild in class IgnoredXMLFragmentLoader

endChild

public void endChild(java.lang.String name)
Specified by:
endChild in interface XMLFragmentLoader
Overrides:
endChild in class IgnoredXMLFragmentLoader

addYourselfInContext

public void addYourselfInContext()
Description copied from interface: XMLFragmentLoader
This is called on end of root element of each fragment

Specified by:
addYourselfInContext in interface XMLFragmentLoader
Overrides:
addYourselfInContext in class IgnoredXMLFragmentLoader

addYourselfToContainer

public void addYourselfToContainer()
This method adds the event to the correct container within the execution result. The container may be specified by a parentId, or may be the root container (which is the outermost execution result, and is signified by an empty parentId.) If the parentId specifies an Invocation Event, then the invocation event is not actually the container. The real container is the execution history that is contained by the execution result contained by the invocation event. (Got that?) To make more sense of this, look at the data model, and see that an execution event can be contained by either another execution event, or by an execution history. If the parentId specifies an invocation event, then the container is really the execution history. If the sortBy field in the XML is not set, then the even is merely added to the execution history. If the sortBy field is set, then the event is inserted into the execution history in the right place based on the field its sorted on.


getReferencedTest

protected TPFTest getReferencedTest()
Returns:

resolveConflict

protected boolean resolveConflict(org.eclipse.emf.common.util.EList events)
This method figures out if there is a conflict to resolve. This makes sense only on typed, timed & wait events for now. However, this may be made useful for other types of events in the future. This method returns false by default, which indicates that there is no conflict resolution needed.

Parameters:
events -
Returns:
false (default) if no conflict resolution required, true if its been taken care of

isIdentical

protected boolean isIdentical(TPFExecutionEvent match)
Check to see if there exists an event in the excution history that's identical to the current event being logged

Parameters:
match -
Returns:

needOverwrite

protected boolean needOverwrite(TPFExecutionEvent match)
Based on the value of the 'conflict' attribute, figures out if an overwrite is required. Specialized events could override this method if there are more specific ways to determine the need to overwrite. if this method determines that the event need not be overwritten, then it is dropped (ignored).

Parameters:
match -
Returns:

overwrite

protected void overwrite(TPFExecutionEvent match)
Overwrite the properties of the basic TPFExecutionEvent

Parameters:
match - - an existing identical event

printTag

protected void printTag(java.lang.String str)

printAttribute

protected void printAttribute(java.lang.String name,
                              java.lang.String value)

printEndTag

protected void printEndTag()

TPTP 4.4.0 Platform Project
Public API Specification