implicit class EnrichedMicrodataDocument extends AnyRef
Implicit typeclass to enrich MicrodataDocument instances with the convertRootsTo method.
- Alphabetic
- By Inheritance
- EnrichedMicrodataDocument
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new EnrichedMicrodataDocument(document: MicrodataDocument)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
convertRootsTo[T](itemtype: URI)(implicit format: MicrodataFormat[T]): Try[Seq[T]]
Automatically de-serialize all root MicrodataItems in a document as convertTo that match the given
itemtype
.Automatically de-serialize all root MicrodataItems in a document as convertTo that match the given
itemtype
. E.g.:scala> import microtesia._ import microtesia._ scala> import formats._ import formats.__ scala> import scala.util.Try import scala.util.Try scala> case class Person(name: String) defined class Person scala> val document = parseMicrodata("""<div itemscope itemtype="http://example.org/person"><h1 itemprop="name">Person</h1></div>""").get document: scala.util.Try[microtesia.MicrodataDocument] = Success(MicrodataDocument(List(MicrodataItem(ArrayBuffer((name,MicrodataString(Avatar))),Some(http://example.org/person),None)))) scala> document.convertRootsTo[Person](new java.net.URI("http://example.org/person")) res0: scala.util.Try[Seq[Person]] = Success(List(Person(Person)))
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )