Package org.apache.jackrabbit.vault.util
Class DocViewNode2
- java.lang.Object
 - 
- org.apache.jackrabbit.vault.util.DocViewNode2
 
 
- 
public class DocViewNode2 extends java.lang.ObjectHelper class that represents an immutable JCR node abstraction encapsulating multipleDocViewProperty2properties.- Since:
 - 3.6.0
 - See Also:
 - FileVault Document View Format
 
 
- 
- 
Constructor Summary
Constructors Constructor Description DocViewNode2(@NotNull Name name, int index, @NotNull java.util.Collection<DocViewProperty2> properties)DocViewNode2(@NotNull Name name, @NotNull java.util.Collection<DocViewProperty2> properties) 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull DocViewNode2cloneWithDifferentProperties(@NotNull java.util.Collection<DocViewProperty2> properties)booleanequals(java.lang.Object obj)static @NotNull DocViewNode2fromNode(@NotNull javax.jcr.Node node, boolean isRoot, boolean useBinaryReferences)static @NotNull DocViewNode2fromNode(@NotNull javax.jcr.Node node, boolean isRoot, @NotNull java.lang.Iterable<javax.jcr.Property> properties, boolean useBinaryReferences)@NotNull java.util.Optional<java.lang.String>getIdentifier()intgetIndex()@NotNull java.util.Collection<java.lang.String>getMixinTypes()@NotNull NamegetName()@NotNull java.util.Optional<java.lang.String>getPrimaryType()@NotNull java.util.Collection<DocViewProperty2>getProperties()@NotNull java.util.Optional<DocViewProperty2>getProperty(Name name)@NotNull java.util.Optional<java.lang.String>getPropertyValue(@NotNull Name name)@NotNull java.util.Collection<java.lang.String>getPropertyValues(@NotNull Name name)@NotNull NamegetSnsAwareName()inthashCode()booleanhasProperty(Name name)java.lang.StringtoString()static voidwriteEnd(@NotNull javax.xml.stream.XMLStreamWriter writer)Writes the node's end tag to the givenXMLStreamWriter.voidwriteStart(@NotNull javax.xml.stream.XMLStreamWriter writer, @NotNull NamespaceResolver nsResolver, @NotNull java.lang.Iterable<java.lang.String> namespacePrefixes)Writes the node's start tag (including the attributes for the properties and optionally the namespace declarations) to the givenXMLStreamWriter. 
 - 
 
- 
- 
Constructor Detail
- 
DocViewNode2
public DocViewNode2(@NotNull @NotNull Name name, @NotNull @NotNull java.util.Collection<DocViewProperty2> properties) 
- 
DocViewNode2
public DocViewNode2(@NotNull @NotNull Name name, int index, @NotNull @NotNull java.util.Collection<DocViewProperty2> properties) 
 - 
 
- 
Method Detail
- 
cloneWithDifferentProperties
@NotNull public @NotNull DocViewNode2 cloneWithDifferentProperties(@NotNull @NotNull java.util.Collection<DocViewProperty2> properties)
 
- 
fromNode
@NotNull public static @NotNull DocViewNode2 fromNode(@NotNull @NotNull javax.jcr.Node node, boolean isRoot, boolean useBinaryReferences) throws javax.jcr.RepositoryException
- Throws:
 javax.jcr.RepositoryException
 
- 
fromNode
@NotNull public static @NotNull DocViewNode2 fromNode(@NotNull @NotNull javax.jcr.Node node, boolean isRoot, @NotNull @NotNull java.lang.Iterable<javax.jcr.Property> properties, boolean useBinaryReferences) throws javax.jcr.RepositoryException
- Throws:
 javax.jcr.RepositoryException
 
- 
getName
@NotNull public @NotNull Name 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:
 - Same-Name Siblings
 
 
- 
getSnsAwareName
@NotNull public @NotNull Name 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
@NotNull public @NotNull java.util.Collection<DocViewProperty2> getProperties()
- Returns:
 - all direct properties of the node represented by this object
 
 
- 
getProperty
@NotNull public @NotNull java.util.Optional<DocViewProperty2> getProperty(Name name)
 
- 
hasProperty
public boolean hasProperty(Name name)
 
- 
getPropertyValues
@NotNull public @NotNull java.util.Collection<java.lang.String> getPropertyValues(@NotNull @NotNull Name name) 
- 
getPropertyValue
@NotNull public @NotNull java.util.Optional<java.lang.String> getPropertyValue(@NotNull @NotNull Name name) 
- 
getPrimaryType
@NotNull public @NotNull java.util.Optional<java.lang.String> getPrimaryType()
 
- 
getMixinTypes
@NotNull public @NotNull java.util.Collection<java.lang.String> getMixinTypes()
 
- 
getIdentifier
@NotNull public @NotNull java.util.Optional<java.lang.String> getIdentifier()
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.lang.Object
 
- 
hashCode
public int hashCode()
- Overrides:
 hashCodein classjava.lang.Object
 
- 
equals
public boolean equals(java.lang.Object obj)
- Overrides:
 equalsin classjava.lang.Object
 
- 
writeStart
public void writeStart(@NotNull @NotNull javax.xml.stream.XMLStreamWriter writer, @NotNull @NotNull NamespaceResolver nsResolver, @NotNull @NotNull java.lang.Iterable<java.lang.String> namespacePrefixes) throws javax.jcr.NamespaceException, javax.xml.stream.XMLStreamExceptionWrites 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:
 javax.jcr.NamespaceException- in case no prefix is defined for the namespace URI of a name (either node's or property's)javax.xml.stream.XMLStreamException- Since:
 - 3.6.2
 
 
- 
writeEnd
public static void writeEnd(@NotNull @NotNull javax.xml.stream.XMLStreamWriter writer) throws javax.xml.stream.XMLStreamExceptionWrites 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:
 javax.xml.stream.XMLStreamException- Since:
 - 3.6.2
 
 
 - 
 
 -