DESCRIPTION

TMF: Refactor XML model code, using factories to re-use element parsers

The same XML syntax (and thus parsing) can be used for many XML components'
element, like state providers and views, but the behavior of each component
may be different. We use a factory to define create the classes with the
various behaviors.

Change-Id: Iec5d54155b93a79b1ebc5ffeb8eaffef5e6569ca
Signed-off-by: Aryana Jones xxx@xxx.xxx


COMMENTS

author: Annalise Jimenez
date: 2014-03-18 19:54:55.000000000

Uploaded patch set 5.

-------------------------------------
author: Brenden Conley
date: 2014-03-18 19:55:34.000000000

Patch Set 5:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/6023/

-------------------------------------
author: Brenden Conley
date: 2014-03-18 20:42:19.000000000

Patch Set 5: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/6023/ : SUCCESS

-------------------------------------
author: Kaeden Tapia
date: 2014-03-21 14:15:58.000000000

Patch Set 5: Code-Review-1

(16 comments)

Line:75, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/stateprovider/XmlStateProvider.java -> It doesn't matter too much here but keep in mind that here toString will put forward slashes on Windows i.e. C:/foo/bar.xml. Since it's being converted back to an IPath after, it *should* work. toOSString would puts backslashes on Windows and forward on everything else and I think that's a bit more correct.

Line:69, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/TmfXmlStateAttribute.java -> rename to fContainer?

Line:171, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/TmfXmlStateAttribute.java -> with this attribute's provider?

Line:47, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/TmfXmlStateValue.java -> fStateValueType instead?

Line:57, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/TmfXmlStateValue.java -> fStackType?

Line:117, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/TmfXmlStateValue.java -> initializeStateValueType instead?

Line:175, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/TmfXmlStateValue.java -> Should this be renamed to reflect the new interface name? (IXmlStateSystemContainer)

Line:180, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/TmfXmlStateValue.java -> with this value's provider

Line:204, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/TmfXmlStateValue.java -> getStackType?

Line:242, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/TmfXmlStateValue.java -> getEventFieldValue? or else it sort of sounds like it will return an ITmfEventField

Line:429, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/TmfXmlStateValue.java -> This needs some description in the javadoc before the params.

Should this method be made abstract?

Line:449, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/TmfXmlStateValue.java -> Should this method be made abstract?

Line:458, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/TmfXmlStateValue.java -> remove TODO

Line:42, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/readwrite/TmfXmlStateAttributeReadWrite.java -> provider -> container?

Line:77, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/TmfXmlStateChange.java -> state system container

Line:56, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/TmfXmlLocation.java -> state system container?

-------------------------------------
author: Annalise Jimenez
date: 2014-03-24 13:44:14.000000000

Patch Set 5:

(2 comments)

ah refactoring! sorry

Line:47, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/TmfXmlStateValue.java -> It's not quite a type either. I'll rename the base class to TmfXmlStateValueBase

Line:429, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/TmfXmlStateValue.java -> No not astract. Some child classes may use this default nothingness behavior, for instance the read-only state value. But some extra refactoring will need to be done in the state value class. The base class is still too much state provider oriented.

But I'll wait till I implement the more complex features of the view (texts in intervals, tooltips), that will make use of this class.

-------------------------------------
