Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'development'

  • Loading branch information...
commit b11cf29acc592c82c94f09839669d96d33b484c8 2 parents e6ce1cd + 9311bb3
@codahale authored
View
2  pom.xml
@@ -6,7 +6,7 @@
<groupId>com.codahale</groupId>
<artifactId>jerkson_2.9.1</artifactId>
- <version>0.5.0</version>
+ <version>0.5.1-SNAPSHOT</version>
<name>Jerkson for Scala ${scala.version}</name>
<properties>
View
184 pom_2.8.2.xml
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>com.codahale</groupId>
- <artifactId>jerkson_2.8.2</artifactId>
- <version>0.5.0</version>
- <name>Jerkson for Scala ${scala.version}</name>
-
- <properties>
- <scala.version>2.8.2</scala.version>
- <jackson.version>[1.9.0,2.0.0)</jackson.version>
- </properties>
-
- <developers>
- <developer>
- <name>Coda Hale</name>
- <email>coda.hale@gmail.com</email>
- <timezone>-8</timezone>
- </developer>
- </developers>
-
- <licenses>
- <license>
- <url>http://codahale.com/mit.txt</url>
- <name>The MIT License</name>
- <distribution>repo</distribution>
- </license>
- </licenses>
-
- <repositories>
- <repository>
- <id>scala-tools-releases</id>
- <url>http://scala-tools.org/repo-releases/</url>
- </repository>
- <repository>
- <id>repo.codahale.com</id>
- <url>http://repo.codahale.com</url>
- </repository>
- </repositories>
-
- <pluginRepositories>
- <pluginRepository>
- <id>scala-tools-releases</id>
- <url>http://scala-tools.org/repo-releases/</url>
- </pluginRepository>
- </pluginRepositories>
-
- <distributionManagement>
- <repository>
- <id>repo.codahale.com</id>
- <url>scp://codahale.com/home/codahale/repo.codahale.com</url>
- </repository>
- </distributionManagement>
-
- <dependencies>
- <dependency>
- <groupId>org.scala-lang</groupId>
- <artifactId>scala-library</artifactId>
- <version>${scala.version}</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-core-asl</artifactId>
- <version>${jackson.version}</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-mapper-asl</artifactId>
- <version>${jackson.version}</version>
- </dependency>
- <dependency>
- <groupId>com.codahale</groupId>
- <artifactId>simplespec_2.8.1</artifactId>
- <version>[0.5.0,0.6.0)</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>sign</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-gpg-plugin</artifactId>
- <version>1.2</version>
- <executions>
- <execution>
- <id>sign-artifacts</id>
- <phase>verify</phase>
- <goals>
- <goal>sign</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.scala-tools</groupId>
- <artifactId>maven-scala-plugin</artifactId>
- <version>2.15.2</version>
- <executions>
- <execution>
- <goals>
- <goal>compile</goal>
- <goal>testCompile</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <args>
- <arg>-optimise</arg>
- <arg>-unchecked</arg>
- <arg>-deprecation</arg>
- </args>
- <charset>UTF-8</charset>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- <encoding>UTF-8</encoding>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.1.2</version>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.5</version>
- <configuration>
- <encoding>UTF-8</encoding>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.8.1</version>
- <configuration>
- <useSystemClassLoader>false</useSystemClassLoader>
- <argLine>-Xmx1024m</argLine>
- <includes>
- <include>**/*Spec.java</include>
- </includes>
- <excludes>
- <exclude>**/*Test.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- <extensions>
- <extension>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-ssh</artifactId>
- <version>1.0-beta-7</version>
- </extension>
- </extensions>
- </build>
-</project>
View
16 src/main/scala/com/codahale/jerkson/AST.scala
@@ -2,15 +2,15 @@ package com.codahale.jerkson
object AST {
sealed trait JValue {
- def value : Any
+ def value: Any
- def valueAs[A] : A = value.asInstanceOf[A]
+ def valueAs[A]: A = value.asInstanceOf[A]
- def \(fieldName : String) : JValue = JNull
+ def \(fieldName: String): JValue = JNull
- def apply(idx : Int) : JValue = JNull
+ def apply(idx: Int): JValue = JNull
- def \\(fieldName : String) : Seq[JValue] = Nil
+ def \\(fieldName: String): Seq[JValue] = Nil
}
case object JNull extends JValue {
@@ -28,7 +28,7 @@ object AST {
case class JArray(elements: List[JValue]) extends JValue {
def value = null
- override def apply(index : Int) : JValue = {
+ override def apply(index: Int): JValue = {
try {
elements(index)
} catch {
@@ -42,7 +42,7 @@ object AST {
case class JObject(fields: List[JField]) extends JValue {
def value = null
- override def \(fieldName : String) : JValue = {
+ override def \(fieldName: String): JValue = {
fields.find { case JField(name, _) =>
name == fieldName
}.map { case JField(_, value) =>
@@ -50,7 +50,7 @@ object AST {
}.getOrElse(JNull)
}
- override def \\(fieldName : String) : Seq[JValue] = {
+ override def \\(fieldName: String): Seq[JValue] = {
fields.flatMap {
case JField(name, value) if name == fieldName => Seq(value) ++ (value \\ fieldName)
case JField(_, value) => value \\ fieldName
Please sign in to comment.
Something went wrong with that request. Please try again.