Package org.eclipse.lemminx.extensions.relaxng.utils

## Class RelaxNGUtils

- java.lang.Object
- - org.eclipse.lemminx.extensions.relaxng.utils.RelaxNGUtils

    public class RelaxNGUtils
    extends Object

RelaxNG utilities.

Author:
  Angelo ZERR

### Nested Class Summary

Nested Classes
`static class` `RelaxNGUtils.BindingType` Binding type of rng grammar

### Field Summary

Fields
`static String` `GRAMMAR_TAG`
`static String` `NAME_ATTR`

### Constructor Summary

Constructors
`RelaxNGUtils()`

### Method Summary

All Methods Static Methods Concrete Methods
`static FilesChangedTracker` `createFilesChangedTracker​(RelaxNGGrammar grammar)`
`static RelaxNGUtils.BindingType` `getBindingType​(DOMAttr originAttr)` Returns the binding type of the origin attribute (ex : ref/@name) which bounds an another target attribute (ex : define/@name).
`static DOMAttr` `getHref​(DOMElement element)`
`static boolean` `isDefine​(Element element)`
`static boolean` `isExternalRef​(Element element)`
`static boolean` `isInclude​(Element element)`
`static boolean` `isRef​(Element element)`
`static boolean` `isRNGTargetElement​(Element element)` Returns true if the given element is an RNG target element (define element) and false otherwise.
`static void` `searchRNGOriginAttributes​(DOMNode targetNode, BiConsumer<DOMAttr,​DOMAttr> collector, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)` Search origin attributes from the given target node..
`static void` `searchRNGTargetAttributes​(DOMAttr originAttr, RelaxNGUtils.BindingType bindingType, boolean matchAttr, boolean searchInExternalSchema, BiConsumer<String,​DOMAttr> collector)` Collect RNG target attributes declared in the RNG grammar according the given attribute and binding type.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### GRAMMAR_TAG

    public static final String GRAMMAR_TAG

See Also:
  Constant Field Values

#### NAME_ATTR

    public static final String NAME_ATTR

See Also:
  Constant Field Values

### Constructor Detail

#### RelaxNGUtils

    public RelaxNGUtils()

### Method Detail

#### createFilesChangedTracker

    public static FilesChangedTracker createFilesChangedTracker​(RelaxNGGrammar grammar)

#### getBindingType

    public static RelaxNGUtils.BindingType getBindingType​(DOMAttr originAttr)

Returns the binding type of the origin attribute (ex : ref/@name) which bounds an another target attribute (ex : define/@name).

Parameters:
  `originAttr` - the origin attribute (ex : ref/@name)
Returns:
  the binding type of the origin attribute (ex : ref/@name) which bounds an another target attribute (ex : define/@name).

#### searchRNGTargetAttributes

    public static void searchRNGTargetAttributes​(DOMAttr originAttr,
                                                 RelaxNGUtils.BindingType bindingType,
                                                 boolean matchAttr,
                                                 boolean searchInExternalSchema,
                                                 BiConsumer<String,​DOMAttr> collector)

Collect RNG target attributes declared in the RNG grammar according the given attribute and binding type.

Parameters:
  `originAttr` - the origin attribute.
  `matchAttr` - true if the attribute value must match the value of target attribute value and false otherwise.
  `searchInExternalSchema` - true if search must be done in included XML Schema (include) and false otherwise.
  `collector` - collector to collect RNG target attributes.

#### searchRNGOriginAttributes

    public static void searchRNGOriginAttributes​(DOMNode targetNode,
                                                 BiConsumer<DOMAttr,​DOMAttr> collector,
                                                 org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)

Search origin attributes from the given target node..

Parameters:
  `targetNode` - the referenced node
  `collector` - the collector to collect reference between an origin and target attribute.

#### isInclude

    public static boolean isInclude​(Element element)

#### isExternalRef

    public static boolean isExternalRef​(Element element)

#### isDefine

    public static boolean isDefine​(Element element)

#### isRef

    public static boolean isRef​(Element element)

#### isRNGTargetElement

    public static boolean isRNGTargetElement​(Element element)

Returns true if the given element is an RNG target element (define element) and false otherwise.

Parameters:
  `element` - the DOM element.
Returns:
  true if the given element is an RNG target element (define element) and false otherwise.

#### getHref

    public static DOMAttr getHref​(DOMElement element)