Abstract base class for XML marshallers of source code metrics.
- The type of metrics the marshaller operates on.| Modifiers | Name | Description |
|---|---|---|
static class |
MetricsXmlMarshaller.CodeElementMetricsMarshaller |
Abstract base class for marshallers of CodeElementMetrics subclasses. |
static class |
MetricsXmlMarshaller.CompilationUnitMetricsMarshaller |
Marshaller of CompilationUnitMetrics instances. |
static class |
MetricsXmlMarshaller.FieldMetricsMarshaller |
Marshaller of FieldMetrics instances. |
static class |
MetricsXmlMarshaller.MethodMetricsMarshaller |
Marshaller of MethodMetrics instances. |
static class |
MetricsXmlMarshaller.PackageMetricsMarshaller |
Marshaller of PackageMetrics instances. |
static class |
MetricsXmlMarshaller.StatementElementMetricsMarshaller |
Abstract base class for marshallers of StatementElementMetrics subclasses. |
static class |
MetricsXmlMarshaller.TypeMetricsMarshaller |
Marshaller of TypeMetrics instances. |
| Constructor and description |
|---|
protected MetricsXmlMarshaller
(java.lang.String pNodeName, java.lang.String pIterableNodeName)Create a new MetricsXmlMarshaller. |
| Type | Name and description |
|---|---|
static void |
addNonZeroAttribute(java.util.Map<?, ?> pAttributes, java.lang.String pKey, int pValue)Add an integer attribute to an attributes map if the value is non-zero. |
org.myire.scent.metrics.AggregatedMetrics |
createAggregatedMetrics(T pMetrics)Create an AggregatedMetrics to use when creating the summary node for a marshalled
T instance. |
java.util.Map<?, ?> |
createNodeAttributes(T pMetrics)Create the attributes for the XML representation of a T instance. |
static groovy.util.Node |
createSummaryNode(org.myire.scent.metrics.AggregatedMetrics pAggregation)Create a summary XML node from an AggregatedMetrics. |
groovy.util.Node |
marshal(T pMetrics)Marshal a metrics instance. |
groovy.util.Node |
marshal(java.lang.Iterable<T> pMetrics)Marshal a sequence of metrics instances. |
void |
marshalChildren(groovy.util.Node pNode, T pMetrics)Append child nodes marshalled from a T instance to a parent node. |
static void |
maybeAppend(groovy.util.Node pParent, groovy.util.Node pChild)Append a child node to a parent node if the former is non-null. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Create a new MetricsXmlMarshaller.
pNodeName - The name of nodes marshalled by this instance.pIterableNodeName - The name of wrapper nodes containing nodes marshalled by this
instance.Add an integer attribute to an attributes map if the value is non-zero.
pAttributes - The attributes map.pKey - The attribute key.pValue - The attribute value. Create an AggregatedMetrics to use when creating the summary node for a marshalled
T instance.
pMetrics - The T instance.AggregatedMetrics instance, or null if the marshalled node shouldn't have
a summary node. Create the attributes for the XML representation of a T instance.
pMetrics - The T instance. Create a summary XML node from an AggregatedMetrics.
pMetrics - The metrics to create the node from.Node, or null if pMetrics is null.Marshal a metrics instance.
pMetrics - The instance to marshal.Node with the XML representation of pMetrics, never null.Marshal a sequence of metrics instances.
pMetrics - The instances to marshal.Node containing one node per instance in pMetrics. If
pMetrics doesn't contain any elements, null is returned. Append child nodes marshalled from a T instance to a parent node. This base
implementation appends a summary node with the aggregation of the T instance as
returned by createAggregatedMetrics().
pNode - The parent node.pMetrics - The metrics to marshal the children of.Append a child node to a parent node if the former is non-null.
pParent - The parent node.pChild - The child node.