AtomAbstractObject: Atom feed class

AtomAbstractObjectR Documentation

Atom feed class

Description

This class models an atom abstract object

Format

R6Class object.

Details

AtomAbstractObject

Value

Object of R6Class for modelling an Atom abstract Object

Super class

atom4R::atom4RLogger -> AtomAbstractObject

Public fields

wrap

wrapping XML element

element

element

namespace

namespace

defaults

defaults

attrs

attrs

printAttrs

attrs to print

parentAttrs

parent attrs

Methods

Public methods

Inherited methods

Method new()

Initializes an object of class AtomAbstractObject

Usage
AtomAbstractObject$new(
  xml = NULL,
  element = NULL,
  namespace = NULL,
  attrs = list(),
  defaults = list(),
  wrap = TRUE,
  logger = "INFO"
)
Arguments
xml

object of class XMLInternalNode-class

element

element

namespace

namespace

attrs

attrs

defaults

defaults

wrap

wrap

logger

logger type


Method setIsDocument()

Set if object is a document or not

Usage
AtomAbstractObject$setIsDocument(isDocument)
Arguments
isDocument

object of class logical


Method isDocument()

Informs if the object is a document

Usage
AtomAbstractObject$isDocument()
Returns

object of class logical


Method getRootElement()

Get root XML element

Usage
AtomAbstractObject$getRootElement()
Returns

object of class character


Method getNamespace()

Get XML namespace

Usage
AtomAbstractObject$getNamespace()
Returns

object of class character


Method createElement()

Creates an element

Usage
AtomAbstractObject$createElement(element, type = "text")
Arguments
element

element

type

type. Default is "text"

Returns

the typed element


Method addListElement()

Add a metadata element to an element list

Usage
AtomAbstractObject$addListElement(field, metadataElement)
Arguments
field

field

metadataElement

metadata element to add

Returns

TRUE if added, FALSE otherwise


Method delListElement()

Deletes a metadata element from an element list

Usage
AtomAbstractObject$delListElement(field, metadataElement)
Arguments
field

field

metadataElement

metadata element to add

Returns

TRUE if deleted, FALSE otherwise


Method contains()

Indicates if an element list contains or not an element

Usage
AtomAbstractObject$contains(field, metadataElement)
Arguments
field

field

metadataElement

metadata element to add

Returns

TRUE if contained, FALSE otherwise


Method print()

Prints the element

Usage
AtomAbstractObject$print(..., depth = 1)
Arguments
...

any parameter to pass to print method

depth

printing depth


Method decode()

Decodes the object from an XML representation

Usage
AtomAbstractObject$decode(xml)
Arguments
xml

object of class XMLInternalNode-class from XML


Method encode()

Encodes the object as XML

Usage
AtomAbstractObject$encode(
  addNS = TRUE,
  validate = TRUE,
  strict = FALSE,
  encoding = "UTF-8"
)
Arguments
addNS

whether namespace has to be added. Default is TRUE

validate

whether validation has to be done vs. XML schemas. Default is TRUE

strict

whether strict validation has to be operated (raise an error if invalid). Default is FALSE

encoding

encoding. Default is "UTF-8"


Method validate()

Validates the object / XML vs. XML schemas

Usage
AtomAbstractObject$validate(xml = NULL, strict = FALSE)
Arguments
xml

object of class XMLInternalNode-class from XML

strict

strict validation or not

Returns

TRUE if valid, FALSE otherwise


Method save()

Saves the object as XML file

Usage
AtomAbstractObject$save(file, ...)
Arguments
file

file name

...

any parameter to pass to encode() method


Method isFieldInheritedFrom()

Indicates the class from which field is inherited

Usage
AtomAbstractObject$isFieldInheritedFrom(field)
Arguments
field

field

Returns

an object of class R6Class, or NULL


Method getClassName()

Get class name

Usage
AtomAbstractObject$getClassName()
Returns

object of class character


Method getClass()

Get class

Usage
AtomAbstractObject$getClass()
Returns

object of class R6Class


Method getNamespaceDefinition()

Get namespace definition

Usage
AtomAbstractObject$getNamespaceDefinition(recursive = FALSE)
Arguments
recursive

recursive

Returns

a named list of the XML namespaces


Method getXmlElement()

Get XML element name

Usage
AtomAbstractObject$getXmlElement()
Returns

object of class character


Method clone()

The objects of this class are cloneable with this method.

Usage
AtomAbstractObject$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Note

abstract class used internally by atom4R

Author(s)

Emmanuel Blondel <emmanuel.blondel1@gmail.com>


atom4R documentation built on Nov. 18, 2022, 5:06 p.m.