alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (AnnotationInfos.scala)

This example Scala source code file (AnnotationInfos.scala) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

annotationinfo, annotationinfo, annotationinfoextractor, anyref, arrayannotarg, arrayannotarg, classfileannotarg, classfileannotarg, list, literalannotarg, literalannotarg, nestedannotarg, nestedannotargextractor, option

The Scala AnnotationInfos.scala source code

package scala.reflect
package generic

@deprecated("scala.reflect.generic will be removed", "2.9.1") trait AnnotationInfos { self: Universe =>

  type AnnotationInfo <: AnyRef
  val AnnotationInfo: AnnotationInfoExtractor

  abstract class AnnotationInfoExtractor {
    def apply(atp: Type, args: List[Tree], assocs: List[(Name, ClassfileAnnotArg)]): AnnotationInfo
    def unapply(info: AnnotationInfo): Option[(Type, List[Tree], List[(Name, ClassfileAnnotArg)])]
  }

  type ClassfileAnnotArg <: AnyRef
  implicit def classfileAnnotArgManifest: ClassManifest[ClassfileAnnotArg] // need a precise manifest to pass to UnPickle's toArray call

  type LiteralAnnotArg <: ClassfileAnnotArg
  val LiteralAnnotArg: LiteralAnnotArgExtractor

  type ArrayAnnotArg <: ClassfileAnnotArg
  val ArrayAnnotArg: ArrayAnnotArgExtractor

  type NestedAnnotArg <: ClassfileAnnotArg
  val NestedAnnotArg: NestedAnnotArgExtractor

  abstract class LiteralAnnotArgExtractor {
    def apply(const: Constant): LiteralAnnotArg
    def unapply(arg: LiteralAnnotArg): Option[Constant]
  }

  abstract class ArrayAnnotArgExtractor {
    def apply(const: Array[ClassfileAnnotArg]): ArrayAnnotArg
    def unapply(arg: ArrayAnnotArg): Option[Array[ClassfileAnnotArg]]
  }

  abstract class NestedAnnotArgExtractor {
    def apply(anninfo: AnnotationInfo): NestedAnnotArg
    def unapply(arg: NestedAnnotArg): Option[AnnotationInfo]
  }
}
  
  

Other Scala examples (source code examples)

Here is a short list of links related to this Scala AnnotationInfos.scala source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

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.