Package org.apache.jackrabbit.vault.util
Class DocViewNode2
java.lang.Object
org.apache.jackrabbit.vault.util.DocViewNode2
Helper class that represents an immutable JCR node abstraction encapsulating multiple
DocViewProperty2 properties.- Since:
- 3.6.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDocViewNode2(@NotNull Name name, int index, @NotNull Collection<DocViewProperty2> properties) DocViewNode2(@NotNull Name name, @NotNull Collection<DocViewProperty2> properties) -
Method Summary
Modifier and TypeMethodDescription@NotNull DocViewNode2cloneWithDifferentProperties(@NotNull Collection<DocViewProperty2> properties) booleanstatic @NotNull DocViewNode2static @NotNull DocViewNode2fromNode(@NotNull Node node, boolean isRoot, @NotNull Iterable<Property> properties, boolean useBinaryReferences) intgetIndex()@NotNull Collection<String>@NotNull NamegetName()@NotNull Collection<DocViewProperty2>@NotNull Optional<DocViewProperty2>getProperty(Name name) getPropertyValue(@NotNull Name name) @NotNull Collection<String>getPropertyValues(@NotNull Name name) @NotNull NameinthashCode()booleanhasProperty(Name name) toString()static voidwriteEnd(@NotNull XMLStreamWriter writer) Writes the node's end tag to the givenXMLStreamWriter.voidwriteStart(@NotNull XMLStreamWriter writer, @NotNull NamespaceResolver nsResolver, @NotNull Iterable<String> namespacePrefixes) Writes the node's start tag (including the attributes for the properties and optionally the namespace declarations) to the givenXMLStreamWriter.
-
Constructor Details
-
DocViewNode2
public DocViewNode2(@NotNull @NotNull Name name, @NotNull @NotNull Collection<DocViewProperty2> properties) -
DocViewNode2
public DocViewNode2(@NotNull @NotNull Name name, int index, @NotNull @NotNull Collection<DocViewProperty2> properties)
-
-
Method Details
-
cloneWithDifferentProperties
@NotNull public @NotNull DocViewNode2 cloneWithDifferentProperties(@NotNull @NotNull Collection<DocViewProperty2> properties) -
fromNode
@NotNull public static @NotNull DocViewNode2 fromNode(@NotNull @NotNull Node node, boolean isRoot, boolean useBinaryReferences) throws RepositoryException - Throws:
RepositoryException
-
fromNode
@NotNull public static @NotNull DocViewNode2 fromNode(@NotNull @NotNull Node node, boolean isRoot, @NotNull @NotNull Iterable<Property> properties, boolean useBinaryReferences) throws RepositoryException - Throws:
RepositoryException
-
getName
- Returns:
- the name of the
Noderepresented by this class
-
getIndex
public int getIndex()- Returns:
- 0, except if there is a same-name sibling in the docview. In that case the index gives the 1-based order of the SNS nodes.
- See Also:
-
getSnsAwareName
- Returns:
- the name suffixed by an index as outlined in Addressing Same-Name Siblings by Path in case there is a same-name sibling, otherwise the same value as for
getName().
-
getProperties
- Returns:
- all direct properties of the node represented by this object
-
getProperty
-
hasProperty
-
getPropertyValues
-
getPropertyValue
-
getPrimaryType
-
getMixinTypes
-
getIdentifier
-
toString
-
hashCode
public int hashCode() -
equals
-
writeStart
public void writeStart(@NotNull @NotNull XMLStreamWriter writer, @NotNull @NotNull NamespaceResolver nsResolver, @NotNull @NotNull Iterable<String> namespacePrefixes) throws NamespaceException, XMLStreamException Writes the node's start tag (including the attributes for the properties and optionally the namespace declarations) to the givenXMLStreamWriter. Use the following writer for properly formatting the output according to FileVault standards:FormattingXmlStreamWriter.create(out, new DocViewFormat().getXmlOutputFormat()).- Parameters:
writer- the XMLStreamWriter to write tonsResolver- the namespace resolver to use for retrieving prefixes for namespace URIs ofgetName()andDocViewProperty2.getName()namespacePrefixes- the namespace prefixes for which to emit namespace declarations in this node- Throws:
NamespaceException- in case no prefix is defined for the namespace URI of a name (either node's or property's)XMLStreamException- Since:
- 3.6.2
-
writeEnd
Writes the node's end tag to the givenXMLStreamWriter. Use the following writer for properly formatting the output according to FileVault standards:FormattingXmlStreamWriter.create(out, new DocViewFormat().getXmlOutputFormat()).- Parameters:
writer- the XMLStreamWriter to write to- Throws:
XMLStreamException- Since:
- 3.6.2
-