net.sf.mmm.util.cli.base
Class CliModeContainer

java.lang.Object
  extended by net.sf.mmm.util.cli.base.CliModeContainer
All Implemented Interfaces:
CliModeObject

public class CliModeContainer
extends Object
implements CliModeObject

This is a container for a CliMode together with additional associated information.

Since:
2.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Field Summary
private  Class<?> annotatedClass
           
private  Set<CliModeContainer> extendedModes
           
private  String id
           
private  CliMode mode
           
private  InitializationState state
           
 
Constructor Summary
  CliModeContainer(CliMode mode, Class<?> annotatedClass)
          The constructor.
private CliModeContainer(CliMode mode, Class<?> annotatedClass, String id)
          The constructor.
  CliModeContainer(String id)
          The constructor for a dummy instance.
 
Method Summary
 Class<?> getAnnotatedClass()
          This method gets the Class that was annotated with the mode.
 Set<CliModeContainer> getExtendedModes()
          This method gets the Set of modes that are extended by this mode including this mode itself.
 String getId()
          The ID of the mode.
 CliMode getMode()
          This method gets the actual CliMode.
 InitializationState getState()
           
 String getTitle()
          The title of the mode.
 void setState(InitializationState state)
           
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

private final String id
See Also:
getId()

mode

private final CliMode mode
See Also:
getMode()

annotatedClass

private final Class<?> annotatedClass
See Also:
getAnnotatedClass()

extendedModes

private final Set<CliModeContainer> extendedModes
See Also:
getExtendedModes()

state

private InitializationState state
See Also:
getState()
Constructor Detail

CliModeContainer

public CliModeContainer(String id)
The constructor for a dummy instance.

Parameters:
id - is the ID.

CliModeContainer

public CliModeContainer(CliMode mode,
                        Class<?> annotatedClass)
The constructor.

Parameters:
mode - is the mode.
annotatedClass - is the annotated class.

CliModeContainer

private CliModeContainer(CliMode mode,
                         Class<?> annotatedClass,
                         String id)
The constructor.

Parameters:
mode - is the mode.
annotatedClass - is the annotated class.
id - is the ID.
Method Detail

getId

public String getId()
The ID of the mode.
ATTENTION:
Please use this method to get the ID as CliModeObject.getMode() may return null.

Specified by:
getId in interface CliModeObject
Returns:
the ID.

getTitle

public String getTitle()
The title of the mode. If the title is NOT set, the ID is returned
ATTENTION:
Please use this method to get the title as CliModeObject.getMode() may return null.

Specified by:
getTitle in interface CliModeObject
Returns:
the title or the ID if title is NOT set.

getMode

public CliMode getMode()
This method gets the actual CliMode.

Specified by:
getMode in interface CliModeObject
Returns:
the CliMode or null if no CliMode annotation was present.

getAnnotatedClass

public Class<?> getAnnotatedClass()
This method gets the Class that was annotated with the mode.

Specified by:
getAnnotatedClass in interface CliModeObject
Returns:
the annotated Class or null if CliModeObject.getMode() is null.

getExtendedModes

public Set<CliModeContainer> getExtendedModes()
This method gets the Set of modes that are extended by this mode including this mode itself.

Specified by:
getExtendedModes in interface CliModeObject
Returns:
the extended modes including this mode itself.

getState

public InitializationState getState()
Returns:
the state

setState

public void setState(InitializationState state)
Parameters:
state - is the state to set

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2001-2010 mmm-Team. All Rights Reserved.