Package

kantan

xpath

Permalink

package xpath

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. xpath
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type Attr = org.w3c.dom.Attr

    Permalink
  2. sealed case class CompileError(message: String) extends XPathError with Product with Serializable

    Permalink

    Describes a XPath expression compilation error.

  3. type CompileResult[A] = Result[CompileError, A]

    Permalink

    Represents the result of taking a string and compiling it into an XPath query.

    Represents the result of taking a string and compiling it into an XPath query.

    See also

    kantan.codecs.Result

  4. trait Compiler[A] extends AnyRef

    Permalink

    Compiles XPath expressions.

    Compiles XPath expressions.

    There's very little reason to interact with this class directly, it's only meant to act as a bridge between XPathCompiler and Query.

  5. sealed abstract class DecodeError extends ReadError

    Permalink

    Describes an error that occurred while decoding some XML content.

  6. type DecodeResult[A] = Result[DecodeError, A]

    Permalink

    Represents the result of taking some raw XPath result and turning it into a usable type.

    Represents the result of taking some raw XPath result and turning it into a usable type.

    Creation methods can be found in the companion object.

    See also

    kantan.codecs.Result

  7. type Document = org.w3c.dom.Document

    Permalink
  8. type Element = org.w3c.dom.Element

    Permalink
  9. type Failure[A] = codecs.Result.Failure[A]

    Permalink
  10. trait GeneratedDecoders extends AnyRef

    Permalink
  11. type InputSource = org.xml.sax.InputSource

    Permalink
  12. type Node = org.w3c.dom.Node

    Permalink
  13. type NodeDecoder[A] = Decoder[Option[Node], A, DecodeError, codecs.type]

    Permalink

    Type class for types that can be decoded from an XML Node.

  14. trait NodeDecoderInstances extends AnyRef

    Permalink

    Provides default NodeDecoder instances.

  15. type NodeList = org.w3c.dom.NodeList

    Permalink
  16. sealed abstract class ParseError extends ReadError

    Permalink

    Describes errors that occur while parsing XML content.

  17. type ParseResult[A] = Result[ParseError, A]

    Permalink

    Represents the result of taking some raw data and turning it into a usable type.

    Represents the result of taking some raw data and turning it into a usable type.

    Creation methods can be found in the companion object.

    See also

    kantan.codecs.Result

  18. trait Query[A] extends AnyRef

    Permalink

    Compiled XPath expression.

    Compiled XPath expression.

    Instance creation is achieved through the companion object.

  19. sealed abstract class ReadError extends XPathError

    Permalink

    Describes an error that occurred while parsing and / or decoding XML content.

  20. type ReadResult[A] = Result[ReadError, A]

    Permalink

    Represents the result of applying an XPath expression, applying to raw data and turning it into usable types.

    Represents the result of applying an XPath expression, applying to raw data and turning it into usable types.

    A ReadResult is either a DecodeResult or a ParseResult.

    See also

    kantan.codecs.Result

  21. final case class RemoteXmlSource[A](toURL: (A) ⇒ ParseResult[URL], retry: RetryStrategy, headers: Map[String, String])(implicit parser: XmlParser) extends XmlSource[A] with Product with Serializable

    Permalink

    XmlSource implementation anything that can be turned into a java.io.URL.

    XmlSource implementation anything that can be turned into a java.io.URL.

    The main purpose here is to allow application developers to set their own HTTP headers: when scrapping websites, it's typically necessary to change the default user agent to something a bit more browser-like.

  22. final case class RetryStrategy(max: Int, delay: Long, factor: (Int) ⇒ Int) extends Product with Serializable

    Permalink

    Describes how to retry failed request for RemoteXmlSource.

    Describes how to retry failed request for RemoteXmlSource.

    Constructors for commonly used patterns can be found in the RetryStrategy$ companion object.

    max

    maximum number of attempts that can be made for a given request.

    delay

    delay, in milliseconds, between each attempt.

    factor

    function that calculates the delay factor based on the number of requests already attempted. In order to double waiting times between each attempt, for example, one would pass i ⇒ 2 ^ i.

  23. type Success[A] = codecs.Result.Success[A]

    Permalink
  24. trait XPathCompiler extends AnyRef

    Permalink

    Compiles XPath expressions.

    Compiles XPath expressions.

    There's always a default instance in scope, which should be perfectly suitable for most circumstances. Still, if some non-standard options are required, one can always declare a local implicit instance.

  25. sealed abstract class XPathError extends Error

    Permalink

    Describes an error that can occur while dealing with XPath.

  26. type XPathExpression = javax.xml.xpath.XPathExpression

    Permalink
  27. type XPathResult[A] = Result[XPathError, A]

    Permalink

    Represents the result of any XPath action.

    Represents the result of any XPath action.

    An XPathResult is either a CompileResult or a ReadResult.

    See also

    kantan.codecs.Result

  28. trait XmlParser extends AnyRef

    Permalink

    Contract for anything that knows how to parse XML.

    Contract for anything that knows how to parse XML.

    The default implementation is always in scope and uses the standard java javax.xml.parsers.DocumentBuilderFactory, with no special option. This can be overridden to set some options or, more drastically, to change the parsing mechanism entirely. A typical use case is the nekohtml module, which needs to take control of the entire parsing process to tidy up messy HTML documents.

  29. trait XmlSource[-A] extends Serializable

    Permalink

    Type class for turning instances of A into valid instances of Node.

    Type class for turning instances of A into valid instances of Node.

    While it's certainly possible, instances of XmlSource are rarely used directly. The preferred, idiomatic way is to use the implicit syntax provided by XmlSourceOps, brought in scope by importing kantan.xpath.ops._.

    See the companion object for construction methods and default instances.

Value Members

  1. object CompileError extends ErrorCompanion[CompileError] with Serializable

    Permalink
  2. object CompileResult extends WithDefault[CompileError]

    Permalink
  3. object Compiler

    Permalink

    Provides implicit methods to summon Compiler instances.

  4. object DecodeError extends Serializable

    Permalink
  5. object DecodeResult extends WithDefault[DecodeError]

    Permalink

    Provides instance creation methods for DecodeResult.

  6. val Failure: codecs.Result.Failure.type

    Permalink
  7. object NodeDecoder extends GeneratedDecoders with DecoderCompanion[Option[Node], DecodeError, codecs.type]

    Permalink

    Provides instance creation and summoning methods.

  8. object ParseError extends Serializable

    Permalink
  9. object ParseResult extends WithDefault[ParseError]

    Permalink

    Provides instance creation methods for ParseResult.

  10. object Query

    Permalink

    Provides convenient methods for XPath expression compilation.

    Provides convenient methods for XPath expression compilation.

    Actual compilation is done through instances of Compiler. Methods declared here will simply summon the right implicit value.

  11. object ReadResult extends Simple[ReadError]

    Permalink
  12. object RetryStrategy extends Serializable

    Permalink
  13. val Success: codecs.Result.Success.type

    Permalink
  14. object XPathCompiler

    Permalink
  15. object XPathResult extends Simple[XPathError]

    Permalink
  16. object XmlParser

    Permalink

    Declares the default XmlParser instance in the implicit scope.

  17. object XmlSource extends Serializable

    Permalink

    Defines convenience methods for creating and summoning XmlSource instances.

    Defines convenience methods for creating and summoning XmlSource instances.

    Default implementation of standard types are declared here, always bringing them in scope without requirnig an explicit import.

    The default implementations can also be useful when writing new instances: if you need to write an XmlSource[T] and already have an XmlSource[S] and a T ⇒ S, you just need to call XmlSource.contramap to get your implementation.

  18. object codecs extends NodeDecoderInstances

    Permalink
  19. object implicits extends ToXPathLiteral with AllOps

    Permalink
  20. package literals

    Permalink
  21. package ops

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped