|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IHierarchyItem
This interface represents the concept of hierarchy composition of objects. This "hierarchy" idea includes relations "parent-child",
"container-element" etc. It also could be recursive - when the parent of one "hierarchy item" could be the child of amother parent.
etc.
Details:
Method Summary | |
---|---|
List |
getAllChilds()
|
List |
getAllParents()
|
IChainHandler |
getChainHandler(IChainMessage message)
Returns the IChainHandler instance appropriate for this message provided (implementation of the handler could
just take into attention the type of message ot could see at the implementation class or the state of message). |
IChainHandler |
getChainHandler(String message)
Returns the IChainHandler instance appropriate for this message type provided. |
List |
getChilds()
|
List |
getChilds(String type)
Return child items by types. |
IHierarchyItem |
getParent()
|
List |
getParents(String type)
Return parent items by type specified. |
IHierarchyItem |
getTopParent()
|
String |
getType()
|
void |
handleMessage(IChainMessage message)
Handle the message passed to the method. |
void |
handleMessage(String message)
Handle the message passed to the method. |
Method Detail |
---|
String getType()
IHierarchyItem
could have the type which is returned here.
In the case the implementation of this interface has not type it could return null
.IHierarchyItem getParent()
IHierarchyItem
. Null could be returned if this element is
the on top of hierarchy.IHierarchyItem getTopParent() throws UnsupportedOperationException
IHierarchyItem
. Null could be returned if this element is
the on top of hierarchy.
UnsupportedOperationException
- in the case this hierarchy item is not allowed to see the top parent evidently.
It depends on the configuration of the system.
TODO: introduce this configurationList getAllParents() throws UnsupportedOperationException
List
of all the parent of this object (all the above recursive parents). Empty
List
could be returned if this element is the on top of hierarchy.
UnsupportedOperationException
- in the case this hierarchy item is not allowed to see all parent evidently.
It depends on the configuration of the system.List getParents(String type) throws UnsupportedOperationException
List
could be returned if this element is the on top of hierarchy.
type
- type of the parents. Can not be null (otherwise IllegalArgumentException
would appear).
List
of all the parent of this object (all the above recursive parents)
UnsupportedOperationException
- in the case this hierarchy item is not allowed to see all parent by their type evidently.
It depends on the configuration of the system.List getChilds()
List
of the IHierarchyItem
objects. Empty List
could be returned if this element
do not have any childs.List getAllChilds() throws UnsupportedOperationException
List
of the IHierarchyItem
objects - all the childs of this item (even visible through
recursion). Empty List
could be returned if this element
do not have any childs.
UnsupportedOperationException
- in the case this hierarchy item is not allowed to see all the childs evidently.
It depends on the configuration of the system.List getChilds(String type) throws UnsupportedOperationException
type
- the type using which the returned items are specified. Empty List
could be returned if this element
do not have any childs.
List
of the IHierarchyItem
objects - all the childs of this item (even visible through
recursion).
UnsupportedOperationException
- in the case this hierarchy item is not allowed to see all the childs evidently.
It depends on the configuration of the system.void handleMessage(String message) throws UnsupportedOperationException
String
notifying the
IHierarchyItem
about some operation.
System.out
details about the current item we could pass here smth like
"PRINT_THIS_ITEM_INFO". Object handleMessage(String message, Object messageBody)
to
allow to pass some message related info - in the case of migrating under Java 5 it would be generics. todo: check itgetChainHandler(String)
to perform the
handle operation or could just compare the message with allowed types and perform smth. without the handler.
message
- the message identifier. Can not be null (otherwise IllegalArgumentException
would appear).
UnsupportedOperationException
- in the case this hierarchy item is not allowed to handle the types of message specified
here and it the system is not configured to pass the control to the parent item.
It depends on the configuration of the system. TODO: introduce this configurationvoid handleMessage(IChainMessage message) throws UnsupportedOperationException
IChainMessage
notifying the
IHierarchyItem
about some operation. This message is rather complicated object cause it allows us to specify the
input and output parameters here (it could be done at the each stage of processing the message - at the hierarhical item,
at the handler, at the inner runner - depending on the security of the system).
getChainHandler(IChainMessage)
to perform
the handle operation or could just compare the message type with allowed types and perform smth. without the handler.
message
- the message identifier. Can not be null (otherwise IllegalArgumentException
would appear).
UnsupportedOperationException
- in the case this hierarchy item is not allowed to handle the types of message specified
here and it the system is not configured to pass the control to the parent item.
It depends on the configuration of the system. TODO: introduce this configurationIChainHandler getChainHandler(String message) throws UnsupportedOperationException
IChainHandler
instance appropriate for this message type provided.
message
- the type of message for which we have appropriate handler.
Can not be null (otherwise IllegalArgumentException
would appear).
IChainHandler
which could be used for performing this operation
UnsupportedOperationException
- in the case this item doesn't have appropriate handlersIChainHandler getChainHandler(IChainMessage message) throws UnsupportedOperationException
IChainHandler
instance appropriate for this message provided (implementation of the handler could
just take into attention the type of message ot could see at the implementation class or the state of message).
todo: specify at the configuration of the system opportunity to map the message to the handler by implemented class, and also
to introduce types of message for this implementation and allow to map different handler classes to it
message
- the message for which we have appropriate handler.
Can not be null (otherwise IllegalArgumentException
would appear).
IChainHandler
which could be used for performing this operation
UnsupportedOperationException
- in the case this item doesn't have appropriate handlers
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |