@API(type=INTERNAL,
src=PUBLIC)
public class CommonsOperationsUtil
extends java.lang.Object
Constructor and Description |
---|
CommonsOperationsUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
buildFreshPrefix(NamespaceContext namespaceContext)
Generates a prefix that is not yet bound to a namespace.
|
static java.lang.String |
setAttributeValue(AuthorDocumentController ctrl,
AuthorElement targetElement,
javax.xml.namespace.QName attributeQName,
java.lang.String value,
boolean removeIfEmpty)
Sets an attribute value.
|
static void |
surroundWithFragment(AuthorAccess authorAccess,
boolean schemaAware,
java.lang.String xmlFragment)
Surround selection with fragment.
|
static int |
surroundWithFragment(AuthorAccess authorAccess,
java.lang.String xmlFragment,
int start,
int end)
Surround the content between start and end offset with the given fragment.
|
static void |
unwrapTags(AuthorAccess authorAccess,
AuthorNode nodeToUnwrap)
Unwrap node tags.
|
public static void unwrapTags(AuthorAccess authorAccess, AuthorNode nodeToUnwrap) throws javax.swing.text.BadLocationException
authorAccess
- The Author access.nodeToUnwrap
- The node to unwrap.javax.swing.text.BadLocationException
public static void surroundWithFragment(AuthorAccess authorAccess, boolean schemaAware, java.lang.String xmlFragment) throws AuthorOperationException
authorAccess
- Author access.schemaAware
- true
for schema aware operationxmlFragment
- The xml fragmentAuthorOperationException
public static int surroundWithFragment(AuthorAccess authorAccess, java.lang.String xmlFragment, int start, int end) throws AuthorOperationException
authorAccess
- Author access.xmlFragment
- The xml fragmentstart
- The start offset.end
- The end offset.AuthorOperationException
public static java.lang.String setAttributeValue(AuthorDocumentController ctrl, AuthorElement targetElement, javax.xml.namespace.QName attributeQName, java.lang.String value, boolean removeIfEmpty)
null
the attribute will
be removed from the element. If the value is the empty string and removeIfEmpty
is true
the attribute will also be removed.ctrl
- Attribute controller.targetElement
- The target element.attributeQName
- Attribute to edit.value
- Current value.removeIfEmpty
- true
to remove the attribute when an empty
value is set.public static java.lang.String buildFreshPrefix(NamespaceContext namespaceContext)
namespaceContext
- Namespace context.© Copyright SyncRO Soft SRL 2002 - 2014. All rights reserved.