com.rojoma.json.matcher

AllOf

case class AllOf (subPatterns: OptPattern*) extends Pattern with Product with Serializable

A Pattern which matches only if all the sub-patterns also match. This pattern cannot be used to generate a JValue.

Linear Supertypes
Serializable, Serializable, Product, Equals, Pattern, OptPattern, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. AllOf
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Pattern
  7. OptPattern
  8. AnyRef
  9. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new AllOf (subPatterns: OptPattern*)

Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  5. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  6. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  7. def canEqual (arg0: Any): Boolean

    Definition Classes
    AllOf → Equals
  8. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  9. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  10. def equals (arg0: Any): Boolean

    Definition Classes
    AllOf → Equals → AnyRef → Any
  11. def evaluate (x: JValue, environment: Results): Option[Results]

    Tests the given JValue against this Pattern, with the restriction that any Variables that are bound in the environment must match those values if they are re-used in this Pattern.

    Tests the given JValue against this Pattern, with the restriction that any Variables that are bound in the environment must match those values if they are re-used in this Pattern.

    Generally you won't use this directly.

    x

    The value to test.

    returns

    The environment augmented with any new Variables encountered in this Pattern, or None if it didn't match.

    Definition Classes
    AllOfPattern
  12. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  13. def generate (environment: Results): None

    Uses this Pattern together with the bindings generated as the result of a call to matches or evaluate to produce a JValue.

    Uses this Pattern together with the bindings generated as the result of a call to matches or evaluate to produce a JValue.

    Generally the other generate method is simpler to use.

    returns

    The new JValue, or None if a required Variable is not bound in the environment, or a matcher which cannot generate is used.

    Definition Classes
    AllOfPattern
  14. def generate (bindings: (Results) ⇒ Results*): JValue

    Uses this Pattern together with the provided variable bindings to generate a new JValue.

    Uses this Pattern together with the provided variable bindings to generate a new JValue.

    returns

    The new JValue

    Definition Classes
    Pattern
    Example:
    1. val intVar = Variable[Int]
      val strVar = Variable[String]
      val pattern = PObject("i" -> intVar, "s" -> POption(strVar))
      
      pattern.generate(i := 1)                      // { "i" : 1 }
      pattern.generate(i := 1, s := "hello")        // { "i" : 1, "s" : "hello" }
      pattern.generate(i := 1, s :=? None )         // { "i" : 1 }
      pattern.generate(i := 1, s :=? Some("hello")) // { "i" : 1, "s" : "hello" }
      
  15. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef
  16. def hashCode (): Int

    Definition Classes
    AllOf → AnyRef → Any
  17. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  18. def matches (x: JValue): Option[Results]

    Tests the given JValue against this Pattern, and if it matches returns an object that can be used to retrieve the values matched by any Variables in the Pattern.

    Tests the given JValue against this Pattern, and if it matches returns an object that can be used to retrieve the values matched by any Variables in the Pattern.

    x

    The value to test.

    returns

    An environment which can be used to look up variable bindings, or None if it didn't match.

    Definition Classes
    Pattern
    Example:
    1. val intVar = Variable[Int]
      val strVar = Variable[String]
      val pattern = PObject("i" -> intVar, "s" -> strVar)
      
      pattern.matches(jvalue) match {
        case Some(results) => println("The integer was " + intVar(results))
        case None => println("It didn't match the pattern")
      }
      
  19. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  20. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  21. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  22. def productArity : Int

    Definition Classes
    AllOf → Product
  23. def productElement (arg0: Int): Any

    Definition Classes
    AllOf → Product
  24. def productIterator : Iterator[Any]

    Definition Classes
    Product
  25. def productPrefix : String

    Definition Classes
    AllOf → Product
  26. val subPatterns : OptPattern*

  27. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  28. def toString (): String

    Definition Classes
    AllOf → AnyRef → Any
  29. def unapply (x: JValue): Option[Results]

    Allows this Pattern to be used in a match expression, with the output being the environment of Variable bindings as produced by matches.

    Allows this Pattern to be used in a match expression, with the output being the environment of Variable bindings as produced by matches.

    Definition Classes
    Pattern
    Example:
    1. val intVar = Variable[Int]
      val strVar = Variable[String]
      val Pattern1 = PObject("i" -> intVar, "s" -> strVar)
      val Pattern2 = PObject("hello" -> "world")
      
      jvalue match {
        case Pattern1(results) => println("The integer was " + intVar(results))
        case Pattern2(result) => println("It was just a hello world object")
        case _ => println("It was something else")
      }
      
  30. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  31. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  32. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  33. def productElements : Iterator[Any]

    Definition Classes
    Product
    Annotations
    @deprecated
    Deprecated

    use productIterator instead

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Pattern

Inherited from OptPattern

Inherited from AnyRef

Inherited from Any