XmpNode
XmpNode Public class
Description
A node in the internally XMP tree, which can be a schema node, a property node, an array node, an array item, a struct node or a qualifier node (without '?').
Possible improvements:
1. The kind Node of node might be better represented by a class-hierarchy of different nodes.
2. The array type should be an enum
3. isImplicitNode should be removed completely and replaced by return values of fi.
4. hasLanguage, hasType should be automatically maintained by XMPNode
@since 21.02.2006
Diagram
flowchart LR
classDef interfaceStyle stroke-dasharray: 5 5;
classDef abstractStyle stroke-width:4px
subgraph iTextSharp.xmp.impl
iTextSharp.xmp.impl.XmpNode[[XmpNode]]
end
subgraph System
System.IComparable[[IComparable]]
System.ICloneable[[ICloneable]]
end
System.IComparable --> iTextSharp.xmp.impl.XmpNode
System.ICloneable --> iTextSharp.xmp.impl.XmpNode
Members
Properties
Public properties
| Type | Name | Methods |
|---|---|---|
bool | Alias | get, set |
int | ChildrenLength | get |
bool | HasAliases | get, set |
bool | HasValueChild | get, set |
bool | Implicit | get, set |
string | Name | get, set |
PropertyOptions | Options | get, set |
XmpNode | Parent | get, set |
int | QualifierLength | get |
IList | UnmodifiableChildren | get |
string | Value | get, set |
Internal properties
| Type | Name | Methods |
|---|---|---|
IList | ChildrenNote: This method should always be called when accessing 'children' to be sure that its initialized. | get |
Methods
Public methods
| Returns | Name |
|---|---|
void | AddChild(...)Adds a node as child to this node. |
void | AddQualifier(XmpNode qualNode)Appends a qualifier to the qualifier list and sets respective options. |
void | Clear()Resets the node. |
object | Clone() |
void | CloneSubtree(XmpNode destination)Performs a deep clone of the complete subtree (children and qualifier )into and add it to the destination node. |
int | CompareTo(object xmpNode) |
string | DumpNode(bool recursive)Renders this node and the tree unter this node in a human readable form. |
XmpNode | FindChildByName(string expr) |
XmpNode | FindQualifierByName(string expr) |
XmpNode | GetChild(int index) |
XmpNode | GetQualifier(int index) |
bool | HasChildren() |
bool | HasQualifier() |
IEnumerator | IterateChildren() |
IEnumerator | IterateQualifier() |
void | RemoveChild(...)Removes a child at the requested index. |
void | RemoveChildren()Removes all children from the node. |
void | RemoveQualifier(XmpNode qualNode)Removes one qualifier node and fixes the options. |
void | RemoveQualifiers()Removes all qualifiers from the node and sets the options appropriate. |
void | ReplaceChild(int index, XmpNode node)Replaces a node with another one. |
void | Sort() |
Protected internal methods
| Returns | Name |
|---|---|
void | CleanupChildren()Removes the children list if this node has no children anymore; checks if the provided node is a schema node and doesn't have any children anymore, its deleted. |
Details
Summary
A node in the internally XMP tree, which can be a schema node, a property node, an array node, an array item, a struct node or a qualifier node (without '?').
Possible improvements:
1. The kind Node of node might be better represented by a class-hierarchy of different nodes.
2. The array type should be an enum
3. isImplicitNode should be removed completely and replaced by return values of fi.
4. hasLanguage, hasType should be automatically maintained by XMPNode
@since 21.02.2006
Inheritance
IComparableICloneable
Constructors
XmpNode [1/2]
Source codepublic XmpNode(string name, string value, PropertyOptions options)
Arguments
| Type | Name | Description |
|---|---|---|
string | name | the name of the node |
string | value | the value of the node |
PropertyOptions | options | the options of the node |
Summary
Creates an
XMPNode
XmpNode [2/2]
Source codepublic XmpNode(string name, PropertyOptions options)
Arguments
| Type | Name | Description |
|---|---|---|
string | name | the name of the node |
PropertyOptions | options | the options of the node |
Summary
Constructor for the node without value.
Methods
Clone
Source codepublic virtual object Clone()
CompareTo
Source codepublic virtual int CompareTo(object xmpNode)
Arguments
| Type | Name | Description |
|---|---|---|
object | xmpNode |
Clear
Source codepublic virtual void Clear()
Summary
Resets the node.
GetChild
Source codepublic virtual XmpNode GetChild(int index)
Arguments
| Type | Name | Description |
|---|---|---|
int | index | an index [1..size] |
Returns
Returns the child with the requested index.
AddChild [1/2]
Source codepublic virtual void AddChild(XmpNode node)
Arguments
| Type | Name | Description |
|---|---|---|
XmpNode | node | an XMPNode |
Summary
Adds a node as child to this node.
Exceptions
| Name | Description |
|---|---|
| XmpException |
AddChild [2/2]
Source codepublic virtual void AddChild(int index, XmpNode node)
Arguments
| Type | Name | Description |
|---|---|---|
int | index | the index of the node before which the new one is inserted. Note: The node children are indexed from [1..size]! An index of size + 1 appends a node. |
XmpNode | node | an XMPNode |
Summary
Adds a node as child to this node.
Exceptions
| Name | Description |
|---|---|
| XmpException |
ReplaceChild
Source codepublic virtual void ReplaceChild(int index, XmpNode node)
Arguments
| Type | Name | Description |
|---|---|---|
int | index | the index of the node that will be replaced. Note: The node children are indexed from [1..size]! |
XmpNode | node | the replacement XMPNode |
Summary
Replaces a node with another one.
RemoveChild [1/2]
Source codepublic virtual void RemoveChild(int itemIndex)
Arguments
| Type | Name | Description |
|---|---|---|
int | itemIndex | the index to remove [1..size] |
Summary
Removes a child at the requested index.
RemoveChild [2/2]
Source codepublic virtual void RemoveChild(XmpNode node)
Arguments
| Type | Name | Description |
|---|---|---|
XmpNode | node | the child node to delete. |
Summary
Removes a child node. If its a schema node and doesn't have any children anymore, its deleted.
CleanupChildren
Source codeprotected internal virtual void CleanupChildren()
Summary
Removes the children list if this node has no children anymore; checks if the provided node is a schema node and doesn't have any children anymore, its deleted.
RemoveChildren
Source codepublic virtual void RemoveChildren()
Summary
Removes all children from the node.
FindChildByName
Source codepublic virtual XmpNode FindChildByName(string expr)
Arguments
| Type | Name | Description |
|---|---|---|
string | expr | child node name to look for |
Returns
Returns an
XMPNode
if node has been found,
null
GetQualifier
Source codepublic virtual XmpNode GetQualifier(int index)
Arguments
| Type | Name | Description |
|---|---|---|
int | index | an index [1..size] |
Returns
Returns the qualifier with the requested index.
AddQualifier
Source codepublic virtual void AddQualifier(XmpNode qualNode)
Arguments
| Type | Name | Description |
|---|---|---|
XmpNode | qualNode | a qualifier node. |
Summary
Appends a qualifier to the qualifier list and sets respective options.
Exceptions
| Name | Description |
|---|---|
| XmpException |
RemoveQualifier
Source codepublic virtual void RemoveQualifier(XmpNode qualNode)
Arguments
| Type | Name | Description |
|---|---|---|
XmpNode | qualNode | qualifier to remove |
Summary
Removes one qualifier node and fixes the options.
RemoveQualifiers
Source codepublic virtual void RemoveQualifiers()
Summary
Removes all qualifiers from the node and sets the options appropriate.
FindQualifierByName
Source codepublic virtual XmpNode FindQualifierByName(string expr)
Arguments
| Type | Name | Description |
|---|---|---|
string | expr | qualifier node name to look for |
Returns
Returns a qualifier
XMPNode
if node has been found,
null
HasChildren
Source codepublic virtual bool HasChildren()
Returns
Returns whether the node has children.
IterateChildren
Source codepublic virtual IEnumerator IterateChildren()
Returns
Returns an iterator for the children. Note: take care to use it.remove(), as the flag are not adjusted in that case.
HasQualifier
Source codepublic virtual bool HasQualifier()
Returns
Returns whether the node has qualifier attached.
IterateQualifier
Source codepublic virtual IEnumerator IterateQualifier()
Returns
Returns an iterator for the qualifier. Note: take care to use it.remove(), as the flag are not adjusted in that case.
CloneSubtree
Source codepublic virtual void CloneSubtree(XmpNode destination)
Arguments
| Type | Name | Description |
|---|---|---|
XmpNode | destination | the node to add the cloned subtree |
Summary
Performs a deep clone of the complete subtree (children and qualifier )into and add it to the destination node.
DumpNode
Source codepublic virtual string DumpNode(bool recursive)
Arguments
| Type | Name | Description |
|---|---|---|
bool | recursive | Flag is qualifier and child nodes shall be rendered too |
Summary
Renders this node and the tree unter this node in a human readable form.
Returns
Returns a multiline string containing the dump.
Sort
Source codepublic virtual void Sort()
Properties
Parent
public virtual XmpNode Parent { get; set; }
ChildrenLength
public virtual int ChildrenLength { get; }
QualifierLength
public virtual int QualifierLength { get; }
Name
public virtual string Name { get; set; }
Value
public virtual string Value { get; set; }
Options
public virtual PropertyOptions Options { get; set; }
Implicit
public virtual bool Implicit { get; set; }
HasAliases
public virtual bool HasAliases { get; set; }
Alias
public virtual bool Alias { get; set; }
HasValueChild
public virtual bool HasValueChild { get; set; }
Children
internal IList Children { get; }
Summary
Note: This method should always be called when accessing 'children' to be sure that its initialized.
UnmodifiableChildren
public virtual IList UnmodifiableChildren { get; }
Generated with ModularDoc