charSequenceExtractor

com.phasmidsoftware.xmldoc.xml.Extractor.charSequenceExtractor
object charSequenceExtractor extends Extractor[CharSequence]

CharSequence extractor.

Attributes

Graph
Supertypes
trait Extractor[CharSequence]
trait NamedFunction[Extractor[CharSequence]]
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def extract(node: Node): Try[CharSequence]

Extracts a CharSequence from an XML Node.

Extracts a CharSequence from an XML Node.

The method attempts to decode the content of the provided Node. If the Node is of type Text or CDATA, the content is extracted directly. Otherwise, it attempts to retrieve the single child node's text content. If the node cannot be decoded into a CharSequence, a failure is returned.

Value parameters

node

the XML Node to extract the CharSequence from.

Attributes

Returns

a Try containing a CharSequence if successfully extracted, or a Failure with an XmlException if decoding fails.

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
NamedFunction -> Any

Inherited methods

def ^+(w: String): Extractor[CharSequence]

Appends the given string to the current name, separated by a colon, and updates the name of the current instance.

Appends the given string to the current name, separated by a colon, and updates the name of the current instance.

Value parameters

w

the string to prepend to the current name.

Attributes

Returns

the instance of the current object cast to type E.

Inherited from:
NamedFunction
def ^^(w: String): Extractor[CharSequence]

Updates the name of the current instance and returns it as the specified type.

Updates the name of the current instance and returns it as the specified type.

Value parameters

w

the new name to be assigned.

Attributes

Returns

the instance of the current object cast to type E.

Inherited from:
NamedFunction
def flatMap[U](f: CharSequence => Try[U]): Extractor[U]

Method to flatMap this Extractor[T] into an Extractor[U].

Method to flatMap this Extractor[T] into an Extractor[U].

Type parameters

U

the underlying type of the result.

Value parameters

f

a T => Try[U].

Attributes

Returns

an Extractor[U].

Inherited from:
Extractor
def lift: Extractor[Option[CharSequence]]

Lifts this Extractor[T] into an Extractor[Option[T]]. If the extraction is successful, the resulting value is wrapped in Some.

Lifts this Extractor[T] into an Extractor[Option[T]]. If the extraction is successful, the resulting value is wrapped in Some.

Attributes

Returns

an Extractor[Option[T]], which extracts an Option[T] from a Node.

Inherited from:
Extractor
def map[U](f: CharSequence => U): Extractor[U]

Method to map this Extractor[T] into an Extractor[U].

Method to map this Extractor[T] into an Extractor[U].

Type parameters

U

the underlying type of the result.

Value parameters

f

a T => U.

Attributes

Returns

an Extractor[U].

Inherited from:
Extractor
def |[P <: CharSequence : Extractor](): Extractor[CharSequence]

Method to create an Extractor[T] such that, if this Extractor[T] fails, then we invoke the (implicit) Extractor[P] instead.

Method to create an Extractor[T] such that, if this Extractor[T] fails, then we invoke the (implicit) Extractor[P] instead.

TESTME

Type parameters

P

the type of the alternative Extractor. P must provide implicit evidence of Extractor[P], and P must be a subclass of T.

Attributes

Returns

an Extractor[T].

Inherited from:
Extractor

Inherited fields

var name: String

Represents the name attribute of a NamedFunction instance.

Represents the name attribute of a NamedFunction instance.

The name is a mutable string variable with a default value of "unnamed". It can be updated via methods such as ^^ and ^+ in the NamedFunction trait.

Attributes

Inherited from:
NamedFunction