score:0
figured it out.
just needed to use m.typesignature
for (m <- typeof[account].members.filter(m => !m.ismethod)) {
| println(m)
| println(m.typesignature)
| }
variable accountnumber
string
variable name
string
score:8
you can use typesignature
:
scala> typeof[account].members.filter(!_.ismethod).foreach(
| sym => println(sym + " is a " + sym.typesignature)
| )
variable accountnumber is a string
variable name is a string
in this context this method will return a reflect.runtime.universe.type
.
Source: stackoverflow.com
Related Query
- Scala - how to get the 'type' for a field using reflection api
- How the get the classOf for a scala object type
- How to make Reflection for getting the field value by its string name and its original type
- How to get the proper return type when using a filter based on type in Scala
- How do you check if a runtime instance conforms to some type using the Scala 2.10 reflection API?
- In Scala, how to use reflection to get the real type of varargs parameters for method
- Get type of primitive field from an object using Scala reflection
- How to get underlying constant type from singleton type with Scala reflection API
- How do I write a query for mongodb using the casbah driver for scala that uses a substring and checks if the field is in a list of supplied values?
- How to get the type of a field using reflection?
- How to use scala reflection API to get all contained classes
- How to get the name of a case class field as a string/symbol at compile time using shapeless?
- Get all the classes that implements a trait in Scala using reflection
- Using Scala 2.10 reflection how can I list the values of Enumeration?
- Get the companion object instance of a inner modul with the Scala reflection API
- How can I use the new reflection API to tell if the component type of an array conforms to a type parameter?
- How to select a object field for map value in Scala using groupby
- How do I get the runtime Class of a parameterized Type in a Scala trait
- Type equality in the Scala 2.10 Reflection API
- How to ask for the same type in Scala generics without introducing a third type parameter?
- How can I get random data generated for scala case classes with the ability to "change some values" for unit testing?
- In scala macros, how to get the complete `extends` clause for a class?
- Scala 2.10 reflection: Why do I get the same type "List()" for the list and list element?
- Is it possible to use reflection to find the actual type of a field declared to be a Scala Enumeration subtype?
- How to see the type of a scala variable? For instance a Spark PairRDD
- How to to get an object out of a HashMap without using the Java Reflection API?
- How to get the COUNT of emails for each id in Scala
- How to get return type string of a method using Scala reflection?
- How to get the set of rows which contains null values from dataframe in scala using filter
- Scala - how come using a super-type with two generic parameters cause the scala type checker to treat the child-type differently?
More Query from same tag
- Count number of quotes in a file using Scala in Spark
- Spark UDF for StructType / Row
- Attempting to run a trivial Scalatest on a Spray Route
- How to build an eclipse plugin with sbt and sbt-osgi?
- Scala - Converting RDD to map
- Bar charts in Scalala
- Reading binary file in Spark Scala
- Unit test async scala code
- Deserialization throws 'ClassNotFoundException: JavaConversions$SeqWrapper' in Scala 2.10
- Play framework - pass parameter to Writes and Reads
- Strip specific part from scala string
- Multiple nullValues in spark csv
- How to launch locally built metals language server?
- Pattern Matching List[Any] with nested lists Scala?
- Complex monad transformer for IO monad
- How to read environment variables in Scala
- Spark Scala generic min() function
- immutable.List source code has "Reassignment to val" error
- Error in Scala Compiler: java.lang.AssertionError: assertion failed (even when project dependency is specified in Eclipse)
- DefaultHTTPClient + chunked encoding
- Using a double value in a Fractional[T] method
- How to parse a nested JSON available in a Hive/Hbase column using spark scala
- Read files recursively in scala
- What version data store does Gremlin create when creating a Neo4j database from the console?
- How to use custom predef for all files in project
- Predictionio pio build succeeds but pio train error No 'name' is found
- Understanding "type arguments do not conform to type parameter bounds" errors in Scala
- Kafka Producer does not write to kafka topic
- How to have Type safe and compiler checked Enums in Scala
- read CSV to Map[String,String]