|
Scala example source code file (HasKeyValue.scala)
The Scala HasKeyValue.scala source code/* __ *\ ** ________ ___ / / ___ Scala API ** ** / __/ __// _ | / / / _ | (c) 2003-2011, LAMP/EPFL ** ** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ package scala.xml /** <p> * Use this class to match on (unprefixed) attribute values * <p>* <b>val hasName = new HasKeyValue("name") * node <b>match { * <b>case Node("foo", hasName(x), _*) => x // foo had attribute with key "name" and with value x * }</pre> * * @author Burak Emir */ @deprecated("Use UnprefixedAttribute's extractor", "2.8.0") class HasKeyValue(key: String) { def unapplySeq(x: MetaData): Option[Seq[Node]] = x.get(key) } |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.