Package io.keikai.doc.collab.types
Class YXmlElement<T>
java.lang.Object
io.keikai.doc.collab.types.AbstractType<YXmlEvent>
io.keikai.doc.collab.types.YXmlFragment<T>
io.keikai.doc.collab.types.YXmlElement<T>
-
Field Summary
Fields inherited from class io.keikai.doc.collab.types.AbstractType
_doc, _length, _map, _searchMarker -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for YXmlElement.YXmlElement(String nodeName) Constructor for YXmlElement. -
Method Summary
Modifier and TypeMethodDescriptionclone()Makes a copy of this data type that can be included somewhere else.copy()Creates an Item with the same effect as this Item (without position effect).getAttribute(String attributeName) Returns an attribute value that belongs to the attribute name.Returns all attribute name/value pairs in a JSON Object.getAttributes(Snapshot snapshot) Returns all attribute name/value pairs in a JSON Object.booleanhasAttribute(String attributeName) Returns whether an attribute exists.voidIntegrate this type into the Yjs instance.static YXmlElementreadYXmlElement(UpdateDecoder decoder) Static method to read a YXmlElement from a decoder.voidremoveAttribute(String attributeName) Removes an attribute from this YXmlElement.<T> voidsetAttribute(String attributeName, T attributeValue) Sets or updates an attribute.voidsetNodeName(String nodeName) toString()Returns the XML serialization of this YXmlElement.voidwrite(UpdateEncoder encoder) Transform the properties of this type to binary and write it to a BinaryEncoder.Methods inherited from class io.keikai.doc.collab.types.YXmlFragment
callObserver, createTreeWalker, delete, delete, forEach, get, getFirstChild, insert, insertAfter, length, push, querySelector, querySelectorAll, readYXmlFragment, slice, toArray, toJSON, toList, unshiftMethods inherited from class io.keikai.doc.collab.types.AbstractType
callTypeObservers, createMapIterator, getDeepEventHandler, getDoc, getFirst, getItem, getMap, getParent, getSearchMarker, getStart, getTypeChildren, isParentOf, observe, observe, observeDeep, setLength, setMap, setStart, typeListCreateIterator, typeListDelete, typeListForEach, typeListForEachSnapshot, typeListGet, typeListInsertGenerics, typeListInsertGenericsAfter, typeListMap, typeListPushGenerics, typeListSlice, typeListToArray, typeListToArraySnapshot, typeMapDelete, typeMapGet, typeMapGetAll, typeMapGetAllSnapshot, typeMapGetSnapshot, typeMapHas, typeMapSet, unobserve, unobserveDeep
-
Constructor Details
-
YXmlElement
public YXmlElement()Constructor for YXmlElement. -
YXmlElement
Constructor for YXmlElement.- Parameters:
nodeName- The name of the XML node. Defaults to 'UNDEFINED'.
-
-
Method Details
-
getNodeName
-
setNodeName
-
getPrelimAttrs
-
getNextSibling
- Returns:
- YXmlElement or YXmlText|null - The next sibling.
-
getPrevSibling
- Returns:
- YXmlElement or YXmlText|null - The previous sibling.
-
integrate
Integrate this type into the Yjs instance.- Overrides:
integratein classYXmlFragment<T>- Parameters:
y- The Yjs instance.item- The item to integrate.
-
copy
Creates an Item with the same effect as this Item (without position effect).- Overrides:
copyin classYXmlFragment<T>- Returns:
- YXmlElement
-
clone
Makes a copy of this data type that can be included somewhere else.Note that the content is only readable _after_ it has been included somewhere in the Ydoc.
- Overrides:
clonein classYXmlFragment<T>- Returns:
- YXmlElement
-
toString
Returns the XML serialization of this YXmlElement. The attributes are ordered by attribute-name, so you can easily use this method to compare YXmlElements.- Overrides:
toStringin classYXmlFragment<T>- Returns:
- String The string representation of this type.
-
removeAttribute
Removes an attribute from this YXmlElement.- Parameters:
attributeName- The attribute name that is to be removed.
-
setAttribute
Sets or updates an attribute.- Parameters:
attributeName- The attribute name that is to be set.attributeValue- The attribute value that is to be set.
-
getAttribute
Returns an attribute value that belongs to the attribute name.- Parameters:
attributeName- The attribute name that identifies the queried value.- Returns:
- The queried attribute value.
-
hasAttribute
Returns whether an attribute exists.- Parameters:
attributeName- The attribute name to check for existence.- Returns:
- boolean - Whether the attribute exists.
-
getAttributes
Returns all attribute name/value pairs in a JSON Object.- Returns:
- A JSON Object (Map) that describes the attributes.
-
getAttributes
Returns all attribute name/value pairs in a JSON Object.- Parameters:
snapshot- Optional snapshot parameter.- Returns:
- A JSON Object (Map) that describes the attributes.
-
write
Transform the properties of this type to binary and write it to a BinaryEncoder.This is called when this Item is sent to a remote peer.
- Overrides:
writein classYXmlFragment<T>- Parameters:
encoder- The encoder to write data to.
-
readYXmlElement
Static method to read a YXmlElement from a decoder.- Parameters:
decoder- The decoder to read data from.- Returns:
- A new YXmlElement instance.
-