|
|||||||||
| Home >> All >> org >> merlotxml >> [ merlot overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.merlotxml.merlot
Class IDManager

java.lang.Objectorg.merlotxml.merlot.IDManager
- All Implemented Interfaces:
- org.merlotxml.util.xml.DTDConstants, MerlotNodeListener
- public class IDManager
- extends java.lang.Object
- implements org.merlotxml.util.xml.DTDConstants, MerlotNodeListener
- extends java.lang.Object
Manages ID and IDRef attributes for one XML file. Generic implementation.
| Field Summary | |
protected java.util.Hashtable |
_attrLastId
contains the last index value used for each named node. |
private int |
_idType
|
private boolean |
_isLogOnSet
|
protected long |
_lastTimeAssigned
Used to check that the same millisecond is not assigned twice. |
private java.lang.String |
_logAttribute
|
private boolean |
_logOn
|
protected MerlotDOMNode |
_rootNode
|
static int |
NODE_HIGHEST
|
static int |
NODE_SMALLEST
|
static int |
NODE_TIMESTAMP
|
static int |
NONE
|
static int |
TIMESTAMP
|
static int |
USERID_TIMESTAMP
|
| Fields inherited from interface org.merlotxml.util.xml.DTDConstants |
ANY, CDATA, COMMENT, COMMENT_KEY, CONTENT_CONCAT, CONTENT_GROUP, CONTENT_LEAF, CONTENT_ONEMAX, CONTENT_OR, CONTENT_PLUS, CONTENT_SINGLE, CONTENT_STAR, EMPTY, GROUP, ID, IDREF, IDREFS, IMPLIED, NMTOKEN, NMTOKENS, PCDATA, PCDATA_KEY, PROCESSING_INSTRUCTION, PROCESSING_INSTRUCTION_KEY, REQUIRED, TOKEN_GROUP |
| Constructor Summary | |
IDManager(MerlotDOMNode rootNode)
|
|
| Method Summary | |
java.util.HashMap |
collectAttributesOfType(MerlotDOMElement start,
int dtdConstant)
|
java.lang.String |
getDefaultIdValue(MerlotDOMNode node,
java.lang.String attrName)
Returns a default string ID attribute value for a node. |
protected java.lang.String |
getDefaultIdValueForIndex(MerlotDOMNode node,
java.lang.String attrName,
int index)
Returns a default string ID attribute value for a node according to an integer index. |
protected java.util.Hashtable |
getIDAttrs(MerlotDOMNode node,
MerlotDOMNode targetNode,
java.lang.String targetAttrName)
Returns all the ID attributes in the document which belongs to a node and its children. |
java.util.Hashtable |
getIDAttrs(MerlotDOMNode targetNode,
java.lang.String targetAttrName)
Returns all the ID attributes in the document. |
int |
getIdTypeSetting()
|
protected java.util.Vector |
getIdValues(MerlotDOMNode targetNode,
java.lang.String targetAttrName)
Returns all the ID attributes in the document. |
java.lang.String |
getLogAttribute()
|
boolean |
getLogLastModifiedSetting()
|
boolean |
isDuplicate(org.w3c.dom.Attr idAttr,
java.util.Vector idValues)
|
void |
logChange(MerlotDOMNode node)
|
void |
nodeChanged(MerlotDOMNode parent,
int[] indices,
MerlotDOMNode[] children)
|
void |
nodeDeleted(MerlotDOMNode node)
|
void |
nodeInserted(MerlotDOMNode parent,
int[] indices,
MerlotDOMNode[] children)
notifies the listener that one or more nodes were inserted under the given parent. |
void |
nodeRemoved(MerlotDOMNode parent,
int[] indices,
MerlotDOMNode[] children)
notifies the listener that one or more nodes under the given parent were deleted. |
java.util.HashMap |
preventDuplicateId(MerlotDOMElement suspect,
java.util.Vector idValues)
|
void |
updateIdRefs(MerlotDOMElement root,
java.util.HashMap changes)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
_rootNode
protected MerlotDOMNode _rootNode
_attrLastId
protected java.util.Hashtable _attrLastId
- contains the last index value used for each named node.
_lastTimeAssigned
protected long _lastTimeAssigned
- Used to check that the same millisecond is not assigned twice.
NONE
public static final int NONE
- See Also:
- Constant Field Values
NODE_SMALLEST
public static final int NODE_SMALLEST
- See Also:
- Constant Field Values
NODE_HIGHEST
public static final int NODE_HIGHEST
- See Also:
- Constant Field Values
TIMESTAMP
public static final int TIMESTAMP
- See Also:
- Constant Field Values
NODE_TIMESTAMP
public static final int NODE_TIMESTAMP
- See Also:
- Constant Field Values
USERID_TIMESTAMP
public static final int USERID_TIMESTAMP
- See Also:
- Constant Field Values
_idType
private int _idType
_isLogOnSet
private boolean _isLogOnSet
_logOn
private boolean _logOn
_logAttribute
private java.lang.String _logAttribute
| Constructor Detail |
IDManager
public IDManager(MerlotDOMNode rootNode)
| Method Detail |
getIDAttrs
public java.util.Hashtable getIDAttrs(MerlotDOMNode targetNode, java.lang.String targetAttrName)
- Returns all the ID attributes in the document.
They are returned in a hashtable with Attr instancies as keys
and the parent node as values.
getIDAttrs
protected java.util.Hashtable getIDAttrs(MerlotDOMNode node, MerlotDOMNode targetNode, java.lang.String targetAttrName)
- Returns all the ID attributes in the document
which belongs to a node and its children.
Unsaved Ids are not taken into account.
They are returned in a hashtable with Attr instancies as keys
and the parent node as values.
getIdValues
protected java.util.Vector getIdValues(MerlotDOMNode targetNode, java.lang.String targetAttrName)
- Returns all the ID attributes in the document.
getDefaultIdValue
public java.lang.String getDefaultIdValue(MerlotDOMNode node, java.lang.String attrName)
- Returns a default string ID attribute value for a node.
This methods checks if there is no interference
with another ID in the document.
getIdTypeSetting
public int getIdTypeSetting()
getDefaultIdValueForIndex
protected java.lang.String getDefaultIdValueForIndex(MerlotDOMNode node, java.lang.String attrName, int index)
- Returns a default string ID attribute value for a node
according to an integer index.
nodeInserted
public void nodeInserted(MerlotDOMNode parent, int[] indices, MerlotDOMNode[] children)
- notifies the listener that one or more nodes were inserted under the
given parent.
IDManager is added as a listener in DOMTreeTableAdapter.
- Specified by:
nodeInsertedin interfaceMerlotNodeListener
nodeRemoved
public void nodeRemoved(MerlotDOMNode parent, int[] indices, MerlotDOMNode[] children)
- notifies the listener that one or more nodes under the given parent
were deleted. Their previous indices are given.
- Specified by:
nodeRemovedin interfaceMerlotNodeListener
nodeDeleted
public void nodeDeleted(MerlotDOMNode node)
- Specified by:
nodeDeletedin interfaceMerlotNodeListener
nodeChanged
public void nodeChanged(MerlotDOMNode parent, int[] indices, MerlotDOMNode[] children)
- Specified by:
nodeChangedin interfaceMerlotNodeListener
preventDuplicateId
public java.util.HashMap preventDuplicateId(MerlotDOMElement suspect, java.util.Vector idValues)
isDuplicate
public boolean isDuplicate(org.w3c.dom.Attr idAttr, java.util.Vector idValues)
updateIdRefs
public void updateIdRefs(MerlotDOMElement root, java.util.HashMap changes)
collectAttributesOfType
public java.util.HashMap collectAttributesOfType(MerlotDOMElement start, int dtdConstant)
getLogLastModifiedSetting
public boolean getLogLastModifiedSetting()
getLogAttribute
public java.lang.String getLogAttribute()
logChange
public void logChange(MerlotDOMNode node)
|
|||||||||
| Home >> All >> org >> merlotxml >> [ merlot overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.merlotxml.merlot.IDManager