XmpNodeUtils Public class
Description
Utilities for ...
Diagram
flowchart LR classDef interfaceStyle stroke-dasharray: 5 5; classDef abstractStyle stroke-width:4px subgraph iTextSharp.xmp.impl iTextSharp.xmp.impl.XmpNodeUtils[[XmpNodeUtils]] end subgraph iTextSharp.xmp iTextSharp.xmp.XmpConst[[XmpConst]] end iTextSharp.xmp.XmpConst --> iTextSharp.xmp.impl.XmpNodeUtils
Members
Methods
Internal Static methods
|
Returns |
Name |
|---|---|
|
|
(
arrayNode, |
|
|
(
arrayNode, |
|
|
(
node)
|
|
|
(
arrayNode)
|
|
|
(
parent, |
|
|
(
xmpTree,
xpath,
leafOptions)
|
|
|
( |
|
|
(
arrayNode, |
|
|
(
arrayNode)
|
|
|
( |
|
|
(
node, |
|
|
(
options, |
Details
Summary
Utilities for
XMPNode
Inheritance
Methods
FindSchemaNode [1/2]
Source code
internal static XmpNode FindSchemaNode(XmpNode tree, string namespaceUri, bool createNodes)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
tree |
the root of the xmp tree. |
|
|
namespaceUri |
a namespace |
|
|
createNodes |
a flag indicating if the node shall be created if not found. Note: The namespace must be registered prior to this call. |
Summary
Find or create a schema node if
createNodes
Returns
Returns the schema node if found,
null
otherwise. Note: If
createNodes
is
true
Exceptions
|
Name |
Description |
|---|---|
|
XmpException |
An exception is only thrown if an error occurred, not if a
|
FindSchemaNode [2/2]
Source code
internal static XmpNode FindSchemaNode(XmpNode tree, string namespaceUri, string suggestedPrefix, bool createNodes)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
tree |
the root of the xmp tree. |
|
|
namespaceUri |
a namespace |
|
|
suggestedPrefix |
If a prefix is suggested, the namespace is allowed to be registered. |
|
|
createNodes |
a flag indicating if the node shall be created if not found. Note: The namespace must be registered prior to this call. |
Summary
Find or create a schema node if
createNodes
Returns
Returns the schema node if found,
null
otherwise. Note: If
createNodes
is
true
Exceptions
|
Name |
Description |
|---|---|
|
XmpException |
An exception is only thrown if an error occurred, not if a
|
FindChildNode
Source code
internal static XmpNode FindChildNode(XmpNode parent, string childName, bool createNodes)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
parent |
the parent node |
|
|
childName |
the node name to find |
|
|
createNodes |
flag, if new nodes shall be created. |
Summary
Find or create a child node under a given parent node. If the parent node is no Returns the found or created child node.
Returns
Returns the found or created node or
null
Exceptions
|
Name |
Description |
|---|---|
|
XmpException |
Thrown if |
FindNode
Source code
internal static XmpNode FindNode(XmpNode xmpTree, XmpPath xpath, bool createNodes, PropertyOptions leafOptions)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
xmpTree |
the node to begin the search. |
|
|
xpath |
the complete xpath |
|
|
createNodes |
flag if nodes shall be created
|
|
|
leafOptions |
the options for the created leaf nodes (only when ... |
Summary
Follow an expanded path expression to find or create a node.
Returns
Returns the node if found or created or
null
Exceptions
|
Name |
Description |
|---|---|
|
XmpException |
An exception is only thrown if an error occurred,
|
DeleteNode
Source code
internal static void DeleteNode(XmpNode node)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
node |
the top-most node to delete. |
Summary
Deletes the the given node and its children from its parent. Takes care about adjusting the flags.
SetNodeValue
Source code
internal static void SetNodeValue(XmpNode node, object value)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
node |
an XMPNode |
|
|
value |
a value |
Summary
This is setting the value of a leaf node.
VerifySetOptions
Source code
internal static PropertyOptions VerifySetOptions(PropertyOptions options, object itemValue)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
options |
the ... |
|
|
itemValue |
the node value to set |
Summary
Verifies the PropertyOptions for consistancy and updates them as needed. If options are
null
Returns
Returns the updated options.
Exceptions
|
Name |
Description |
|---|---|
|
XmpException |
If the options are not consistant. |
SerializeNodeValue
Source code
internal static string SerializeNodeValue(object value)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
value |
the node value to set |
Summary
Converts the node value to String, apply special conversions for defined types in XMP.
Returns
Returns the String representation of the node value.
NormalizeLangArray
Source code
internal static void NormalizeLangArray(XmpNode arrayNode)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
arrayNode |
an alt text array node |
Summary
Make sure the x-default item is first. Touch up "single value" arrays that have a default plus one real language. This case should have the same value for both items. Older Adobe apps were hardwired to only use the "x-default" item, so we copy that value to the other item.
DetectAltText
Source code
internal static void DetectAltText(XmpNode arrayNode)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
arrayNode |
the array node to check if its an alt-text array |
Summary
See if an array is an alt-text array. If so, make sure the x-default item is first.
AppendLangItem
Source code
internal static void AppendLangItem(XmpNode arrayNode, string itemLang, string itemValue)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
arrayNode |
the language array |
|
|
itemLang |
the language of the item |
|
|
itemValue |
the content of the item |
Summary
Appends a language item to an alt text array.
Exceptions
|
Name |
Description |
|---|---|
|
XmpException |
Thrown if a duplicate property is added |
ChooseLocalizedText
Source code
internal static object ChooseLocalizedText(XmpNode arrayNode, string genericLang, string specificLang)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
arrayNode |
|
|
|
genericLang |
|
|
|
specificLang |
LookupLanguageItem
Source code
internal static int LookupLanguageItem(XmpNode arrayNode, string language)
Arguments
|
Type |
Name |
Description |
|---|---|---|
|
|
arrayNode |
an array node |
|
|
language |
the requested language |
Summary
Looks for the appropriate language item in a text alternative array.item
Returns
Returns the index if the language has been found, -1 otherwise.
Exceptions
|
Name |
Description |
|---|---|
|
XmpException |
Generated with ModularDoc