public abstract class HandleChain extends HandleResource implements CommonHandleChain, Deletable
attribute or base method | API |
---|---|
NAME | name() |
PREV-SIBLING | getPrevSibling() |
NEXT-SIBLING | getNextSibling() |
PRIVATE-DATA | getPrivateData() , setPrivateData(character) and
setPrivateData(String)
|
The abstract class also provides setters for the implemented attributes which are not defined inside the interfaces to be used for initializing of those attributes
Modifier and Type | Class and Description |
---|---|
private static class |
HandleChain.WorkArea
Stores global data relating to the state of the current context.
|
Modifier and Type | Field and Description |
---|---|
private static ContextLocal<HandleChain.WorkArea> |
local
This context's chain-related data.
|
protected character |
name
Variable for holding the name attribute.
|
protected HandleChain |
nextSibling
Variable for holding the NEXT-SIBLING attribute.
|
protected HandleChain |
prevSibling
Variable for holding the PREV-SIBLING attribute.
|
private character |
privateData
Variable for holding the privateData attribute.
|
instProc
Constructor and Description |
---|
HandleChain()
Default c'tor.
|
HandleChain(boolean dynamic)
Create this dynamic or static resource.
|
HandleChain(boolean dynamic,
boolean saveFirstLast)
Create this dynamic or static resource.
|
HandleChain(boolean dynamic,
boolean saveFirstLast,
HandleChain before,
boolean firstAsLast)
Create this dynamic or static resource.
|
Modifier and Type | Method and Description |
---|---|
void |
delete()
Perform actual delete of an resource.
|
protected static handle |
firstResource(HandleChain parent,
java.lang.String type)
Get the first resource in the chain, for the given class.
|
protected static handle |
firstResource(java.lang.String type)
Get the first resource in the chain, for the given class.
|
protected static HandleChain |
getHead(java.lang.String type)
Get the first unwrapped resource in the chain, for the given class.
|
handle |
getNextSibling()
Get the
next-sibling attribute of this handle. |
handle |
getNextSibling(HandleChain parent)
Get the
next-sibling attribute of this handle. |
handle |
getPrevSibling()
Get the
prev-sibling attribute of this handle. |
handle |
getPrevSibling(HandleChain parent)
Get the
prev-sibling attribute of this handle. |
character |
getPrivateData()
Get the
private-data attribute of this handle. |
protected static HandleChain |
getTail(java.lang.String type)
Get the last unwrapped resource in the chain, for the given class.
|
protected boolean |
hasName()
Check if this resource supports the NAME attribute.
|
protected boolean |
hasNameReadOnly()
Check if this resource supports the NAME attribute in read-only mode.
|
protected boolean |
hasNextSibling()
Check if this resource supports the NEXT-SIBLING attribute.
|
protected boolean |
hasParent(HandleChain parent)
Check if this resource has as parent the specified resource.
|
protected boolean |
hasPrevSibling()
Check if this resource supports the PREV-SIBLING attribute.
|
protected boolean |
hasPrivateData()
Check if this resource supports the PRIVATE-DATA attribute.
|
protected void |
interlink()
Interlinks the newly created HandleChain in the both chains.
|
protected boolean |
isChained()
Check if this resource can be reported as chained.
|
protected static handle |
lastResource(HandleChain parent,
java.lang.String type)
Get the last resource in the chain, for the given class.
|
protected static handle |
lastResource(java.lang.String type)
Get the last resource in the chain, for the given class.
|
void |
moveInChain(boolean head)
Move the this resource to the head or tail of the chain
|
character |
name()
Get the
name attribute of handle. |
void |
name(character name)
Sets the name of this handle.This method is outside interfaces and only
meant for initializing this within the implementation.
|
void |
name(java.lang.String name)
Sets the name of this handle.This method is outside interfaces and only
meant for initializing this within the implementation.
|
void |
readOnlyError(java.lang.String attribute)
Show a specific error, as this read-only
attribute was used
on the right-side of an assignment. |
private java.lang.String |
resolveType()
Resolve the resource's type, for internal management purposes.
|
protected abstract boolean |
resourceDelete()
Worker to be implemented by each resource.
|
protected static HandleChain |
setHead(java.lang.String type,
HandleChain resource)
Set the first unwrapped resource in the chain, for the given class.
|
void |
setNextSibling(handle nextSibling)
Sets the NEXT-SIBLING attribute of this handle.
|
void |
setNextSibling(HandleChain nextSibling)
Sets the NEXT-SIBLING attribute of this handle.
|
void |
setPrevSibling(handle prevSibling)
Sets the PREV-SIBLING attribute of this handle.
|
void |
setPrevSibling(HandleChain prevSibling)
Sets the PREV-SIBLING attribute of this handle.
|
void |
setPrivateData(BaseDataType data)
Set the
private-data attribute of this handle. |
void |
setPrivateData(character data)
Set the
private-data attribute of this handle. |
void |
setPrivateData(java.lang.String data)
Set the
private-data attribute of this handle. |
getResourceType, id, id, implicitDeletion, instantiatingProcedure, invalidAttribute, setInstantiatingProcedure, type, unknown
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getResourceType
id, id, unknown, valid
private static final ContextLocal<HandleChain.WorkArea> local
protected final character name
private final character privateData
protected HandleChain prevSibling
protected HandleChain nextSibling
public HandleChain()
public HandleChain(boolean dynamic)
dynamic
- Flag indicating if this is a static or dynamic resource.public HandleChain(boolean dynamic, boolean saveFirstLast)
dynamic
- Flag indicating if this is a static or dynamic resource.saveFirstLast
- Flag indicating if the first/last resource should be updated.public HandleChain(boolean dynamic, boolean saveFirstLast, HandleChain before, boolean firstAsLast)
dynamic
- Flag indicating if this is a static or dynamic resource.saveFirstLast
- Flag indicating if the first/last resource should be updated.before
- The right neighbor of the BaseEntity been created or null if new BaseEntity
will be the last in the chain. If before is the first element in the chain
the new BaseEntity will become the new first element in the chain.firstAsLast
- The flag indicating that this new entity must be inserted as last element
in the chain in the case when before - is the first element of the chain.
When before is the first element of the chain, default behavior (expected
from the name of this parameter is to insert new element as the first.
This flag allows to change the expected behavior of before parameter when
it needs and makes sense only if before is the first element.protected static handle firstResource(java.lang.String type)
type
- The resource type.protected static handle firstResource(HandleChain parent, java.lang.String type)
parent
- The parent for which the first child is needed. If null
, the first
resource with no parent set is returned.type
- The resource type.protected static HandleChain getHead(java.lang.String type)
type
- The resource type.protected static HandleChain setHead(java.lang.String type, HandleChain resource)
type
- The resource type.resource
- The resource to be set the head of the chain (the first in chain).protected static handle lastResource(java.lang.String type)
type
- The resource type.protected static handle lastResource(HandleChain parent, java.lang.String type)
parent
- The parent for which the last child is needed. If null
, the last
resource with no parent set is returned.type
- The resource type.protected static HandleChain getTail(java.lang.String type)
type
- The resource type.protected abstract boolean resourceDelete()
delete()
.true
if the resource was deleted.public void readOnlyError(java.lang.String attribute)
attribute
was used
on the right-side of an assignment.readOnlyError
in interface CommonHandle
readOnlyError
in class HandleResource
attribute
- The read-only attribute.protected void interlink()
This method is protected since it needs to be called on BUFFERs at a later moment than their construction, when they are configured as dynamic.
public void delete()
public character name()
name
attribute of handle.public void name(character name)
public void name(java.lang.String name)
public handle getNextSibling()
next-sibling
attribute of this handle.getNextSibling
in interface CommonHandleChain
public handle getNextSibling(HandleChain parent)
next-sibling
attribute of this handle.parent
- The parent for which the first child is needed. If null
, the first
resource with no parent set is returned.public void setNextSibling(handle nextSibling)
nextSibling
- The next sibling handle in the chain.public void setNextSibling(HandleChain nextSibling)
nextSibling
- The next sibling resource in the chain.public handle getPrevSibling()
prev-sibling
attribute of this handle.getPrevSibling
in interface CommonHandleChain
public handle getPrevSibling(HandleChain parent)
prev-sibling
attribute of this handle.parent
- The parent for which the first child is needed. If null
, the first
resource with no parent set is returned.public void setPrevSibling(handle prevSibling)
prevSibling
- The previous sibling handle in the chain.public void setPrevSibling(HandleChain prevSibling)
prevSibling
- The previous sibling resource in the chain.public character getPrivateData()
private-data
attribute of this handle.getPrivateData
in interface CommonHandleChain
public void setPrivateData(character data)
private-data
attribute of this handle.setPrivateData
in interface CommonHandleChain
data
- The new private-data value.public void setPrivateData(java.lang.String data)
private-data
attribute of this handle.setPrivateData
in interface CommonHandleChain
data
- The new private-data value.public void setPrivateData(BaseDataType data)
private-data
attribute of this handle.data
- The new private-data value.public void moveInChain(boolean head)
head
- If true
, move to head otherwise tail.protected boolean hasNextSibling()
true
if the resource has the attribute.protected boolean hasPrevSibling()
true
if the resource has the attribute.protected boolean hasNameReadOnly()
true
if the resource has the attribute in r/o mode.protected boolean hasName()
true
if the resource has the attribute.protected boolean hasPrivateData()
true
if the resource has the attribute.protected boolean isChained()
true
. Subclasses can override this as needed.protected boolean hasParent(HandleChain parent)
parent
- The parent for which the first child is needed. If null
, the first
resource with no parent set is returned.true
. Subclasses can override this as needed.private java.lang.String resolveType()
For DIALOG-BOX and FRAME, FRAME is returned, as these are linked in the same chain.