C# Class iTextSharp.xmp.impl.XmpNode

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: IComparable, ICloneable
Exibir arquivo Open project: nonorganic/dssnet Class Usage Examples

Private Properties

Property Type Description
AssertChildNotExisting void
AssertQualifierNotExisting void
DumpNode void
find XmpNode

Public Methods

Method Description
AddChild ( XmpNode node ) : void

Adds a node as child to this node.

AddChild ( int index, XmpNode node ) : void

Adds a node as child to this node.

AddQualifier ( XmpNode qualNode ) : void

Appends a qualifier to the qualifier list and sets respective options.

Clear ( ) : void

Resets the node.

Clone ( ) : object

Performs a deep clone of the node and the complete subtree.

CloneSubtree ( XmpNode destination ) : void

Performs a deep clone of the complete subtree (children and qualifier )into and add it to the destination node.

CompareTo ( object xmpNode ) : int
DumpNode ( bool recursive ) : string

Renders this node and the tree unter this node in a human readable form.

FindChildByName ( string expr ) : XmpNode
FindQualifierByName ( string expr ) : XmpNode
GetChild ( int index ) : XmpNode
GetQualifier ( int index ) : XmpNode
HasChildren ( ) : bool
HasQualifier ( ) : bool
IterateChildren ( ) : IEnumerator
IterateQualifier ( ) : IEnumerator
RemoveChild ( XmpNode node ) : void

Removes a child node. If its a schema node and doesn't have any children anymore, its deleted.

RemoveChild ( int itemIndex ) : void

Removes a child at the requested index.

RemoveChildren ( ) : void

Removes all children from the node.

RemoveQualifier ( XmpNode qualNode ) : void

Removes one qualifier node and fixes the options.

RemoveQualifiers ( ) : void

Removes all qualifiers from the node and sets the options appropriate.

ReplaceChild ( int index, XmpNode node ) : void

Replaces a node with another one.

Sort ( ) : void

Sorts the complete datamodel according to the following rules:

  • Nodes at one level are sorted by name, that is prefix + local name
  • Starting at the root node the children and qualifier are sorted recursively, which the following exceptions.
  • Sorting will not be used for arrays.
  • Within qualifier "xml:lang" and/or "rdf:type" stay at the top in that order, all others are sorted.

XmpNode ( string name, PropertyOptions options ) : System

Constructor for the node without value.

XmpNode ( string name, string value, PropertyOptions options ) : System

Creates an XMPNode with initial values.

Protected Methods

Method Description
CleanupChildren ( ) : void

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.

Private Methods

Method Description
AssertChildNotExisting ( string childName ) : void

Checks that a node name is not existing on the same level, except for array items.

AssertQualifierNotExisting ( string qualifierName ) : void

Checks that a qualifier name is not existing on the same level.

DumpNode ( StringBuilder result, bool recursive, int indent, int index ) : void

Dumps this node and its qualifier and children recursively. Note: It creats empty options on every node.

find ( IList list, string expr ) : XmpNode

Internal find.

Method Details

AddChild() public method

Adds a node as child to this node.
public AddChild ( XmpNode node ) : void
node XmpNode an XMPNode
return void

AddChild() public method

Adds a node as child to this node.
public AddChild ( int index, XmpNode node ) : void
index int 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.
node XmpNode an XMPNode
return void

AddQualifier() public method

Appends a qualifier to the qualifier list and sets respective options.
public AddQualifier ( XmpNode qualNode ) : void
qualNode XmpNode a qualifier node.
return void

CleanupChildren() protected method

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.
protected CleanupChildren ( ) : void
return void

Clear() public method

Resets the node.
public Clear ( ) : void
return void

Clone() public method

Performs a deep clone of the node and the complete subtree.
public Clone ( ) : object
return object

CloneSubtree() public method

Performs a deep clone of the complete subtree (children and qualifier )into and add it to the destination node.
public CloneSubtree ( XmpNode destination ) : void
destination XmpNode the node to add the cloned subtree
return void

CompareTo() public method

public CompareTo ( object xmpNode ) : int
xmpNode object
return int

DumpNode() public method

Renders this node and the tree unter this node in a human readable form.
public DumpNode ( bool recursive ) : string
recursive bool Flag is qualifier and child nodes shall be rendered too
return string

FindChildByName() public method

public FindChildByName ( string expr ) : XmpNode
expr string child node name to look for
return XmpNode

FindQualifierByName() public method

public FindQualifierByName ( string expr ) : XmpNode
expr string qualifier node name to look for
return XmpNode

GetChild() public method

public GetChild ( int index ) : XmpNode
index int an index [1..size]
return XmpNode

GetQualifier() public method

public GetQualifier ( int index ) : XmpNode
index int an index [1..size]
return XmpNode

HasChildren() public method

public HasChildren ( ) : bool
return bool

HasQualifier() public method

public HasQualifier ( ) : bool
return bool

IterateChildren() public method

public IterateChildren ( ) : IEnumerator
return IEnumerator

IterateQualifier() public method

public IterateQualifier ( ) : IEnumerator
return IEnumerator

RemoveChild() public method

Removes a child node. If its a schema node and doesn't have any children anymore, its deleted.
public RemoveChild ( XmpNode node ) : void
node XmpNode the child node to delete.
return void

RemoveChild() public method

Removes a child at the requested index.
public RemoveChild ( int itemIndex ) : void
itemIndex int the index to remove [1..size]
return void

RemoveChildren() public method

Removes all children from the node.
public RemoveChildren ( ) : void
return void

RemoveQualifier() public method

Removes one qualifier node and fixes the options.
public RemoveQualifier ( XmpNode qualNode ) : void
qualNode XmpNode qualifier to remove
return void

RemoveQualifiers() public method

Removes all qualifiers from the node and sets the options appropriate.
public RemoveQualifiers ( ) : void
return void

ReplaceChild() public method

Replaces a node with another one.
public ReplaceChild ( int index, XmpNode node ) : void
index int the index of the node that will be replaced. /// Note: The node children are indexed from [1..size]!
node XmpNode the replacement XMPNode
return void

Sort() public method

Sorts the complete datamodel according to the following rules:
  • Nodes at one level are sorted by name, that is prefix + local name
  • Starting at the root node the children and qualifier are sorted recursively, which the following exceptions.
  • Sorting will not be used for arrays.
  • Within qualifier "xml:lang" and/or "rdf:type" stay at the top in that order, all others are sorted.
public Sort ( ) : void
return void

XmpNode() public method

Constructor for the node without value.
public XmpNode ( string name, PropertyOptions options ) : System
name string the name of the node
options iTextSharp.xmp.options.PropertyOptions the options of the node
return System

XmpNode() public method

Creates an XMPNode with initial values.
public XmpNode ( string name, string value, PropertyOptions options ) : System
name string the name of the node
value string the value of the node
options iTextSharp.xmp.options.PropertyOptions the options of the node
return System