Skip to main content
Skip table of contents

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
TypeNameMethods
boolAliasget, set
intChildrenLengthget
boolHasAliasesget, set
boolHasValueChildget, set
boolImplicitget, set
stringNameget, set
PropertyOptionsOptionsget, set
XmpNodeParentget, set
intQualifierLengthget
IListUnmodifiableChildrenget
stringValueget, set
Internal properties
TypeNameMethods
IListChildren
Note: This method should always be called when accessing 'children' to be sure
that its initialized.
get

Methods

Public methods
ReturnsName
voidAddChild(...)
Adds a node as child to this node.
voidAddQualifier(XmpNode qualNode)
Appends a qualifier to the qualifier list and sets respective options.
voidClear()
Resets the node.
objectClone()
voidCloneSubtree(XmpNode destination)
Performs a deep clone of the complete subtree (children and
qualifier )into and add it to the destination node.
intCompareTo(object xmpNode)
stringDumpNode(bool recursive)
Renders this node and the tree unter this node in a human readable form.
XmpNodeFindChildByName(string expr)
XmpNodeFindQualifierByName(string expr)
XmpNodeGetChild(int index)
XmpNodeGetQualifier(int index)
boolHasChildren()
boolHasQualifier()
IEnumeratorIterateChildren()
IEnumeratorIterateQualifier()
voidRemoveChild(...)
Removes a child at the requested index.
voidRemoveChildren()
Removes all children from the node.
voidRemoveQualifier(XmpNode qualNode)
Removes one qualifier node and fixes the options.
voidRemoveQualifiers()
Removes all qualifiers from the node and sets the options appropriate.
voidReplaceChild(int index, XmpNode node)
Replaces a node with another one.
voidSort()
Protected internal methods
ReturnsName
voidCleanupChildren()
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

  • IComparable
  • ICloneable

Constructors

XmpNode [1/2]

Source code

public XmpNode(string name, string value, PropertyOptions options)
Arguments
TypeNameDescription
stringnamethe name of the node
stringvaluethe value of the node
PropertyOptionsoptionsthe options of the node
Summary

Creates an

XMPNode
XmpNode [2/2]

Source code

public XmpNode(string name, PropertyOptions options)
Arguments
TypeNameDescription
stringnamethe name of the node
PropertyOptionsoptionsthe options of the node
Summary

Constructor for the node without value.

Methods

Clone

Source code

public virtual object Clone()
CompareTo

Source code

public virtual int CompareTo(object xmpNode)
Arguments
TypeNameDescription
objectxmpNode
Clear

Source code

public virtual void Clear()
Summary

Resets the node.

GetChild

Source code

public virtual XmpNode GetChild(int index)
Arguments
TypeNameDescription
intindexan index [1..size]
Returns

Returns the child with the requested index.

AddChild [1/2]

Source code

public virtual void AddChild(XmpNode node)
Arguments
TypeNameDescription
XmpNodenodean XMPNode
Summary

Adds a node as child to this node.

Exceptions
NameDescription
XmpException
AddChild [2/2]

Source code

public virtual void AddChild(int index, XmpNode node)
Arguments
TypeNameDescription
intindexthe 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.
XmpNodenodean XMPNode
Summary

Adds a node as child to this node.

Exceptions
NameDescription
XmpException
ReplaceChild

Source code

public virtual void ReplaceChild(int index, XmpNode node)
Arguments
TypeNameDescription
intindexthe index of the node that will be replaced. Note: The node children are indexed from [1..size]!
XmpNodenodethe replacement XMPNode
Summary

Replaces a node with another one.

RemoveChild [1/2]

Source code

public virtual void RemoveChild(int itemIndex)
Arguments
TypeNameDescription
intitemIndexthe index to remove [1..size]
Summary

Removes a child at the requested index.

RemoveChild [2/2]

Source code

public virtual void RemoveChild(XmpNode node)
Arguments
TypeNameDescription
XmpNodenodethe 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 code

protected 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 code

public virtual void RemoveChildren()
Summary

Removes all children from the node.

FindChildByName

Source code

public virtual XmpNode FindChildByName(string expr)
Arguments
TypeNameDescription
stringexprchild node name to look for
Returns

Returns an

XMPNode

if node has been found,

null
GetQualifier

Source code

public virtual XmpNode GetQualifier(int index)
Arguments
TypeNameDescription
intindexan index [1..size]
Returns

Returns the qualifier with the requested index.

AddQualifier

Source code

public virtual void AddQualifier(XmpNode qualNode)
Arguments
TypeNameDescription
XmpNodequalNodea qualifier node.
Summary

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

Exceptions
NameDescription
XmpException
RemoveQualifier

Source code

public virtual void RemoveQualifier(XmpNode qualNode)
Arguments
TypeNameDescription
XmpNodequalNodequalifier to remove
Summary

Removes one qualifier node and fixes the options.

RemoveQualifiers

Source code

public virtual void RemoveQualifiers()
Summary

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

FindQualifierByName

Source code

public virtual XmpNode FindQualifierByName(string expr)
Arguments
TypeNameDescription
stringexprqualifier node name to look for
Returns

Returns a qualifier

XMPNode

if node has been found,

null
HasChildren

Source code

public virtual bool HasChildren()
Returns

Returns whether the node has children.

IterateChildren

Source code

public 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 code

public virtual bool HasQualifier()
Returns

Returns whether the node has qualifier attached.

IterateQualifier

Source code

public 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 code

public virtual void CloneSubtree(XmpNode destination)
Arguments
TypeNameDescription
XmpNodedestinationthe 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 code

public virtual string DumpNode(bool recursive)
Arguments
TypeNameDescription
boolrecursiveFlag 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 code

public 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

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.