Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Jul 29, 2014
@adamretter adamretter [doc] Added javadoc about Element serialization ec9527a
Commits on Aug 04, 2014
@wolfgangmm wolfgangmm Merge pull request #280 from adamretter/develop
[doc] Added javadoc about Element serialization
88da1a2
Showing with 39 additions and 0 deletions.
  1. +39 −0 src/org/exist/dom/ElementImpl.java
View
39 src/org/exist/dom/ElementImpl.java
@@ -166,6 +166,44 @@ public boolean declaresNamespacePrefixes() {
return (namespaceMappings.size() > 0);
}
+ /**
+ * Serializes a (persistent DOM) Element to a byte array
+ *
+ * data = signature childCount nodeIdUnitsLength nodeId attributesCount localNameId namespace? prefixData?
+ *
+ * signature = 0x20 | localNameLength | hasNamespace? | isDirty?
+ *
+ * localNameLength = noContent OR intContent OR shortContent OR byteContent
+ * noContent = 0x0
+ * intContent = 0x1
+ * shortContent = 0x2
+ * byteContent = 0x3
+ *
+ * hasNamespace = 0x10
+ *
+ * isDirty = 0x8
+ *
+ * childCount = [int] (4 bytes) The number of child nodes
+ * nodeIdUnitsLength = [short] (2 bytes) The number of units of the element's NodeId
+ * nodeId = @see org.exist.numbering.DLNBase#serialize(byte[], int)
+ * attributesCount = [short] (2 bytes) The number of attributes
+ *
+ * localNameId = [int] (4 bytes) | [short] (2 bytes) | [byte] 1 byte. The Id of the element's local name from SymbolTable (symbols.dbx)
+ *
+ * namespace = namespaceUriId namespacePrefixLength elementNamespacePrefix?
+ * namespaceUriId = [short] (2 bytes) The Id of the namespace URI from SymbolTable (symbols.dbx)
+ * namespacePrefixLength = [short] (2 bytes)
+ * elementNamespacePrefix = eUtf8
+ *
+ * eUtf8 = @see org.exist.util.UTF8#encode(java.lang.String, byte[], int)
+ *
+ * prefixData = namespaceMappingsCount namespaceMapping+
+ * namespaceMappingsCount = [short] (2 bytes)
+ * namespaceMapping = namespacePrefix namespaceUriId
+ * namespacePrefix = jUtf8
+ *
+ * jUtf8 = @see java.io.DataOutputStream#writeUTF(java.lang.String)
+ */
@Override
public byte[] serialize() {
if (nodeId == null)
@@ -188,6 +226,7 @@ public boolean declaresNamespacePrefixes() {
}
prefixData = bout.toByteArray();
}
+
final short id = symbols.getSymbol(this);
final boolean hasNamespace = nodeName.needsNamespaceDecl();
short nsId = 0;

No commit comments for this range

Something went wrong with that request. Please try again.