Skip to content

Commit

Permalink
Merge branch 'release/2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mhgrove committed Jun 14, 2016
2 parents d5dace6 + 3d1f1d5 commit 1ff3cc1
Show file tree
Hide file tree
Showing 14 changed files with 421 additions and 421 deletions.
14 changes: 8 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ sourceSets {
}

group = "com.complexible.pinto"
version = "1.0.1"
version = "2.0"

ext {
projectDescription = "Pinto: A lightweight framework for mapping Java Beans into RDF and back again"
projectUrl = "https://github.com/complexible/pinto"
}

sourceCompatibility = '1.7'
targetCompatibility = '1.7'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'

repositories {
mavenCentral()
Expand All @@ -52,11 +52,13 @@ dependencies {
compile "commons-beanutils:commons-beanutils:1.9.2"
compile "commons-codec:commons-codec:1.10"

compile "com.complexible.common:cp-openrdf-utils:3.0.1"
compile "com.complexible.common:cp-common-utils:4.0"
compile "com.complexible.common:cp-openrdf-utils:4.0.1"
compile ("com.complexible.common:cp-common-utils:5.0.1") {
exclude group: "org.slf4j"
}

// these should be coming from cp-openrdf-utils, but it's missing these
compile "org.openrdf.sesame:sesame-rio-ntriples:2.7.14"
compile "org.openrdf.sesame:sesame-rio-ntriples:4.0.0"

compile "org.slf4j:slf4j-api:1.7.7"
compile "org.slf4j:slf4j-jdk14:1.7.7"
Expand Down
10 changes: 5 additions & 5 deletions main/src/com/complexible/common/reflect/Classes.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Modifier;

import com.complexible.common.collect.Iterables2;
import com.google.common.base.Predicates;
import com.google.common.collect.Lists;

import static com.google.common.collect.Iterables.any;

Expand All @@ -28,8 +28,8 @@
*
* @author Michael Grove
*
* @version 1.0
* @since 1.0
* @version 2.0
*/
public final class Classes {

Expand All @@ -50,11 +50,11 @@ public static boolean _implements(final Class<?> theClass, final Class<?> theInt

/**
* Return all the interfaces of the {@link Class} as an {@link Iterable}
* @param theClass
* @return
* @param theClass the class
* @return the interfaces of the class
*/
public static Iterable<Class<?>> interfaces(final Class<?> theClass) {
return Iterables2.forArray(theClass.getInterfaces());
return Lists.newArrayList(theClass.getInterfaces());
}

/**
Expand Down
35 changes: 13 additions & 22 deletions main/src/com/complexible/common/reflect/Methods.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@
import java.beans.Introspector;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

import com.google.common.base.Function;
import com.google.common.base.Predicate;
import java.util.function.Function;
import java.util.function.Predicate;

/**
* <p>Utility for working with Methods via Java reflect</p>
*
* @author Michael Grove
* @version 1.0
* @since 1.0
* @since 2.0
*/
public final class Methods {

Expand All @@ -42,12 +41,7 @@ private Methods() {
* @return a predicate that will check a method for the annotation
*/
public static Predicate<Method> annotated(final Class<? extends Annotation> theAnnotation) {
return new Predicate<Method>() {
@Override
public boolean apply(final Method theInput) {
return theInput != null && theInput.getAnnotation(theAnnotation) != null;
}
};
return theInput -> theInput != null && theInput.getAnnotation(theAnnotation) != null;
}

/**
Expand All @@ -56,19 +50,16 @@ public boolean apply(final Method theInput) {
* @return property name function
*/
public static Function<Method, String> property() {
return new Function<Method, String>() {
@Override
public String apply(final Method input) {
int aLen = 0;
if (input.getName().startsWith("is")) {
aLen = 2;
}
else if (input.getName().startsWith("get") || input.getName().startsWith("set")) {
aLen = 3;
}

return Introspector.decapitalize(input.getName().substring(aLen));
return input -> {
int aLen = 0;
if (input.getName().startsWith("is")) {
aLen = 2;
}
else if (input.getName().startsWith("get") || input.getName().startsWith("set")) {
aLen = 3;
}

return Introspector.decapitalize(input.getName().substring(aLen));
};
}
}
8 changes: 4 additions & 4 deletions main/src/com/complexible/pinto/RDFCodec.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package com.complexible.pinto;

import com.complexible.common.openrdf.util.ResourceBuilder;
import org.openrdf.model.Graph;
import org.openrdf.model.Model;
import org.openrdf.model.Resource;

/**
Expand All @@ -28,14 +28,14 @@
*
* @author Michael Grove
* @since 1.0
* @version 1.0
* @version 2.0
*/
public interface RDFCodec<T> {

/**
* Serialize the given value as RDF. This should produce a round-trippable serialization, that is, the output of
* this method should return an object that is {@code .equals} to the result of passing the RDF to
* {@link #readValue(Graph, Resource)}.
* {@link #readValue(Model, Resource)}.
*
* @param theValue the value to serialize
*
Expand All @@ -52,5 +52,5 @@ public interface RDFCodec<T> {
*
* @throws RDFMappingException if there is an error while deserializing
*/
public T readValue(final Graph theGraph, final Resource theObj);
public T readValue(final Model theGraph, final Resource theObj);
}
Loading

0 comments on commit 1ff3cc1

Please sign in to comment.