org.finra.jtaf.core.utilities.logging
Class Section

java.lang.Object
  extended by org.finra.jtaf.core.utilities.logging.Section

public class Section
extends Object

Serves as a container for messages and other message sections. TODO: Sections and Messages should have the same base class, but I can't think of a good word for it.


Constructor Summary
Section(String name)
          External classes are only allowed to instantiate root message sections.
 
Method Summary
 void addMessage(Message message)
          Inserts the message into this section.
 org.apache.log4j.Level getLevel()
          A section's level is Max(max level of subsection, max level of message).
 List<Message> getMessages()
           
 String getName()
          A text label for the section.
 Section getParent()
           
 List<Section> getSections()
           
 boolean isEmpty()
          Does this Section contain anything useful?
 Section newSection(String name)
          Retrieves the section w/ the given name, or creates a new section if none w/ the given name exists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Section

public Section(String name)
External classes are only allowed to instantiate root message sections. Subsections are created automatically upon request.

Parameters:
name -
Method Detail

getName

public final String getName()
A text label for the section. Something like "In file XYZ"

Returns:

isEmpty

public final boolean isEmpty()
Does this Section contain anything useful?

Returns:

newSection

public Section newSection(String name)
Retrieves the section w/ the given name, or creates a new section if none w/ the given name exists

Parameters:
name -
Returns:

getSections

public List<Section> getSections()
Returns:
A list of subsections

addMessage

public final void addMessage(Message message)
Inserts the message into this section. If the message's level is greater than this section's level, the section set its level equal to the message's level and inform its parent.

Parameters:
message -

getMessages

public final List<Message> getMessages()
Returns:
A list of the messages within this section

getLevel

public final org.apache.log4j.Level getLevel()
A section's level is Max(max level of subsection, max level of message). In other words, the level is the greatest level of a child element.

Returns:

getParent

public final Section getParent()
Returns:
The parent of this section, or null if this section is the root


Copyright © 2014. All rights reserved.