Class nl.sara.webdav.Property
a WebDAV property
Defined in: property.js.
Constructor Attributes | Constructor Name and Description |
---|---|
nl.sara.webdav.Property(xmlNode, status, responsedescription, errors)
|
Field Attributes | Field Name and Description |
---|---|
The namespace
|
|
The response description
|
|
The (HTTP) status code
|
|
The tag name
|
|
A NodeList with the value of this property
|
Method Attributes | Method Name and Description |
---|---|
<static> |
nl.sara.webdav.Property.addCodec(codec)
Adds functions to encode or decode properties
This allows exact control in how Property.xmlvalue is parsed when
getParsedValue() is called or how it is rebuild when
setValueAndRebuildXml() is called.
|
addError(error)
Adds an error to this property
|
|
Returns all errors
|
|
Parses the xmlvalue
If a codec for this property is specified, it will use this codec to parse
the XML nodes.
|
|
setValueAndRebuildXml(value)
Sets a new value and rebuilds xmlvalue
If a codec for this property is specified, it will use this codec to
rebuild xmlvallue.
|
|
toString()
Overloads the default toString() method so it returns the value of this property
|
Class Detail
nl.sara.webdav.Property(xmlNode, status, responsedescription, errors)
- Parameters:
- {Node} xmlNode Optional
- Optional; The xmlNode describing the propstat object (should be compliant with RFC 4918)
- {Number} status Optional
- Optional; The (HTTP) status code
- {String} responsedescription Optional
- Optional; The response description
- {String[]} errors Optional
- Optional; An array of errors
Field Detail
{String}
namespace
The namespace
{String}
responsedescription
The response description
{Number}
status
The (HTTP) status code
{String}
tagname
The tag name
{NodeList}
xmlvalue
A NodeList with the value of this property
Method Detail
<static>
{void}
nl.sara.webdav.Property.addCodec(codec)
Adds functions to encode or decode properties
This allows exact control in how Property.xmlvalue is parsed when
getParsedValue() is called or how it is rebuild when
setValueAndRebuildXml() is called. You can specify two functions: 'fromXML'
and 'toXML'. These should be complementary. That is, toXML should be able
to create a NodeList based on the output of fromXML. For example:
A == toXML(fromXML(A)) &&
B == fromXML(toXML(B))
- Parameters:
- {nl.sara.webdav.Codec} codec
- The codec to add
- Returns:
- {void}
{Property}
addError(error)
Adds an error to this property
- Parameters:
- {Node} error
- The Node which represents the error
- Returns:
- {Property} Itself for chaining multiple methods
{array}
getErrors()
Returns all errors
- Returns:
- {array} An array of Node representing the error
{mixed}
getParsedValue()
Parses the xmlvalue
If a codec for this property is specified, it will use this codec to parse
the XML nodes. Else it will attempt to parse it as text or CDATA elements.
- Returns:
- {mixed} If a codec is specified, the return type depends on that codec. If no codec is specified and at least one node in xmlvalue is not a text or CDATA node, it will return undefined. If xmlvalue is empty, it will return null.
{void}
setValueAndRebuildXml(value)
Sets a new value and rebuilds xmlvalue
If a codec for this property is specified, it will use this codec to
rebuild xmlvallue. Else it will attempt to create one CDATA element with
the string value of whatever was fiven as parameter.
- Parameters:
- {mixed} value
- The object to base the xmlvalue on
- Returns:
- {void}
{String}
toString()
Overloads the default toString() method so it returns the value of this property
- Returns:
- {String} A string representation of this property