Skip to content
This repository has been archived by the owner on Jun 8, 2018. It is now read-only.

Commit

Permalink
Extend and Fix Up javadoc
Browse files Browse the repository at this point in the history
- add javadoc for orm codec module
- fix javadoc for orm core module
- fix javadoc for api* module
  • Loading branch information
denisneuling committed Mar 15, 2013
1 parent 4606ed0 commit 3c922b2
Show file tree
Hide file tree
Showing 32 changed files with 338 additions and 45 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ language: java
jdk:
- openjdk6
- openjdk7
- oraclejdk6
- oraclejdk7
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Maven parent project, which contains the Java [apitrary Backend as a Service](http://apitrary.com/) client and orm modules.


### Getting Started
---

Expand All @@ -25,6 +26,7 @@ The latest apitrary artifacts are published to maven central. Bringing apitrary
</dependencies>
```


### Requirements
---

Expand Down Expand Up @@ -66,7 +68,19 @@ For Maven: [Building a Project with Maven](http://maven.apache.org/run-maven/ind
* [apitrary-api-client](https://github.com/denisneuling/apitrary.jar/tree/master/apitrary-api-client/)
* [apitrary-orm](https://github.com/denisneuling/apitrary.jar/tree/master/apitrary-orm/)


### Interested into somewhat like build stability?
---

* Have a look at [Apitrary.jar at Travis CI](https://travis-ci.org/denisneuling/apitrary.jar)


### What about interface documentation? - Javadoc.
---

* [apitrary-api Javadoc](http://denisneuling.github.com/apitrary.jar/apitrary-api/)
* [apitrary-api-client Javadoc](http://denisneuling.github.com/apitrary.jar/apitrary-api-client/)
* [apitrary-orm-core Javadoc](http://denisneuling.github.com/apitrary.jar/apitrary-orm/apitrary-orm-core/)
* [apitrary-orm-codec Javadoc](http://denisneuling.github.com/apitrary.jar/apitrary-orm/apitrary-orm-codec/)

_Note: The Javadoc will be exported once a release, so it might differ from the current master branch implementation._
14 changes: 14 additions & 0 deletions apitrary-api-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Maven parent project, which contains the Java [apitrary Backend as a Service](http://apitrary.com/) client and orm modules.


### Getting Started
---

Expand All @@ -25,6 +26,7 @@ The latest apitrary artifacts are published to maven central. Bringing apitrary
</dependencies>
```


### Requirements
---

Expand Down Expand Up @@ -66,7 +68,19 @@ For Maven: [Building a Project with Maven](http://maven.apache.org/run-maven/ind
* [apitrary-api-client](https://github.com/denisneuling/apitrary.jar/tree/master/apitrary-api-client/)
* [apitrary-orm](https://github.com/denisneuling/apitrary.jar/tree/master/apitrary-orm/)


### Interested into somewhat like build stability?
---

* Have a look at [Apitrary.jar at Travis CI](https://travis-ci.org/denisneuling/apitrary.jar)


### What about interface documentation? - Javadoc.
---

* [apitrary-api Javadoc](http://denisneuling.github.com/apitrary.jar/apitrary-api/)
* [apitrary-api-client Javadoc](http://denisneuling.github.com/apitrary.jar/apitrary-api-client/)
* [apitrary-orm-core Javadoc](http://denisneuling.github.com/apitrary.jar/apitrary-orm/apitrary-orm-core/)
* [apitrary-orm-codec Javadoc](http://denisneuling.github.com/apitrary.jar/apitrary-orm/apitrary-orm-codec/)

_Note: The Javadoc will be exported once a release, so it might differ from the current master branch implementation._
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,25 @@ public class ApitraryClient extends AbstractApitraryClient {
private int connectionTimeout = DEFAULTCONNECTIONTIMEOUT;
private int receiveTimeout = DEFAULTRECEIVETIMEOUT;

/**
* <p>
* Constructor for ApitraryClient.
* </p>
*
* @param api
* a {@link com.apitrary.api.client.ApitraryApi} object.
*/
protected ApitraryClient(ApitraryApi api) {
this.api = api;
}

/**
* <p>
* Constructor for ApitraryClient.
* </p>
*
* @since 0.1.1
*/
protected ApitraryClient() {
throw new RuntimeException("Apitrary Client needs to connect to the targeted API. Hint: Use factory method #connectTo(ApitraryApi api)");
}
Expand Down Expand Up @@ -156,6 +171,7 @@ protected WebClient instantiateWebClient() {
* </p>
*
* @return a int.
* @since 0.1.1
*/
public int getConnectionTimeout() {
return connectionTimeout;
Expand All @@ -168,6 +184,7 @@ public int getConnectionTimeout() {
*
* @param connectionTimeout
* a int.
* @since 0.1.1
*/
public void setConnectionTimeout(int connectionTimeout) {
this.connectionTimeout = connectionTimeout;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,14 @@ public static Field[] getAllDeclaredFields(Class<?> clazz) {
* a {@link java.lang.Class} object.
* @param referenceClazz
* a {@link java.lang.Class} object.
* @param referenceClazz
* a {@link java.lang.Class} object.
* @param referenceClazz
* a {@link java.lang.Class} object.
* @param referenceClazz
* a {@link java.lang.Class} object.
* @param referenceClazz
* a {@link java.lang.Class} object.
* @param valueType
* a {@link java.lang.Class} object.
* @param <T>
Expand Down Expand Up @@ -216,6 +224,14 @@ public static <T> T getValueOf(Field field, Object reference, Class<?> reference
* a {@link java.lang.Class} object.
* @param referenceClazz
* a {@link java.lang.Class} object.
* @param referenceClazz
* a {@link java.lang.Class} object.
* @param referenceClazz
* a {@link java.lang.Class} object.
* @param referenceClazz
* a {@link java.lang.Class} object.
* @param referenceClazz
* a {@link java.lang.Class} object.
* @param valueType
* a {@link java.lang.Class} object.
* @param <T>
Expand Down
14 changes: 14 additions & 0 deletions apitrary-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Maven parent project, which contains the Java [apitrary Backend as a Service](http://apitrary.com/) client and orm modules.


### Getting Started
---

Expand All @@ -25,6 +26,7 @@ The latest apitrary artifacts are published to maven central. Bringing apitrary
</dependencies>
```


### Requirements
---

Expand Down Expand Up @@ -66,7 +68,19 @@ For Maven: [Building a Project with Maven](http://maven.apache.org/run-maven/ind
* [apitrary-api-client](https://github.com/denisneuling/apitrary.jar/tree/master/apitrary-api-client/)
* [apitrary-orm](https://github.com/denisneuling/apitrary.jar/tree/master/apitrary-orm/)


### Interested into somewhat like build stability?
---

* Have a look at [Apitrary.jar at Travis CI](https://travis-ci.org/denisneuling/apitrary.jar)


### What about interface documentation? - Javadoc.
---

* [apitrary-api Javadoc](http://denisneuling.github.com/apitrary.jar/apitrary-api/)
* [apitrary-api-client Javadoc](http://denisneuling.github.com/apitrary.jar/apitrary-api-client/)
* [apitrary-orm-core Javadoc](http://denisneuling.github.com/apitrary.jar/apitrary-orm/apitrary-orm-core/)
* [apitrary-orm-codec Javadoc](http://denisneuling.github.com/apitrary.jar/apitrary-orm/apitrary-orm-codec/)

_Note: The Javadoc will be exported once a release, so it might differ from the current master branch implementation._
4 changes: 4 additions & 0 deletions apitrary-orm/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@

# Maven Files #
target/


#temporarily
apitrary-orm-query/
14 changes: 14 additions & 0 deletions apitrary-orm/apitrary-orm-codec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Maven parent project, which contains the Java [apitrary Backend as a Service](http://apitrary.com/) client and orm modules.


### Getting Started
---

Expand All @@ -25,6 +26,7 @@ The latest apitrary artifacts are published to maven central. Bringing apitrary
</dependencies>
```


### Requirements
---

Expand Down Expand Up @@ -66,7 +68,19 @@ For Maven: [Building a Project with Maven](http://maven.apache.org/run-maven/ind
* [apitrary-api-client](https://github.com/denisneuling/apitrary.jar/tree/master/apitrary-api-client/)
* [apitrary-orm](https://github.com/denisneuling/apitrary.jar/tree/master/apitrary-orm/)


### Interested into somewhat like build stability?
---

* Have a look at [Apitrary.jar at Travis CI](https://travis-ci.org/denisneuling/apitrary.jar)


### What about interface documentation? - Javadoc.
---

* [apitrary-api Javadoc](http://denisneuling.github.com/apitrary.jar/apitrary-api/)
* [apitrary-api-client Javadoc](http://denisneuling.github.com/apitrary.jar/apitrary-api-client/)
* [apitrary-orm-core Javadoc](http://denisneuling.github.com/apitrary.jar/apitrary-orm/apitrary-orm-core/)
* [apitrary-orm-codec Javadoc](http://denisneuling.github.com/apitrary.jar/apitrary-orm/apitrary-orm-codec/)

_Note: The Javadoc will be exported once a release, so it might differ from the current master branch implementation._
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*
* @author Denis Neuling ([email protected])
*
* @since 0.1.1
*/
public class Base64Codec extends Codec<byte[]> {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright 2012-2013 Denis Neuling
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.apitrary.orm.codec.date;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

import com.apitrary.orm.core.codec.Codec;

/**
* @author Denis Neuling ([email protected])
*
*/
public class DateISO8601Codec extends Codec<Date> {

/** {@inheritDoc} */
@Override
public Date decode(String value) {
Calendar calendar = GregorianCalendar.getInstance();
String s = value.replace("Z", "+00:00");
try {
s = s.substring(0, 22) + s.substring(23);
} catch (IndexOutOfBoundsException e) {
throw new RuntimeException(e);
}
Date date;
try {
date = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").parse(s);
calendar.setTime(date);
return calendar.getTime();
} catch (ParseException e) {
throw new RuntimeException(e);
}
}

/** {@inheritDoc} */
@Override
public String encode(Date object) {
String formatted = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(object);
return formatted.substring(0, 22) + ":" + formatted.substring(22);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@
import com.apitrary.orm.core.codec.Codec;

/**
* <p>
* ImageGIFCodec class.
* </p>
*
* @author Denis Neuling ([email protected])
*
* @since 0.1.1
*/
public class ImageGIFCodec extends Codec<Image> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@
import com.apitrary.orm.core.codec.Codec;

/**
* <p>
* ImageJPGCodec class.
* </p>
*
* @author Denis Neuling ([email protected])
*
* @since 0.1.1
*/
public class ImageJPGCodec extends Codec<Image> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@
import com.apitrary.orm.core.codec.Codec;

/**
* <p>
* ImagePNGCodec class.
* </p>
*
* @author Denis Neuling ([email protected])
*
* @since 0.1.1
*/
public class ImagePNGCodec extends Codec<Image> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@

/**
* @author Denis Neuling ([email protected])
*
*
*/
public class Base64CodecTest {

private Base64Codec codec;

private String string = "abcdefghijklmnopqrstuvwxyz0123456789";

@Before
public void setUp(){
public void setUp() {
codec = new Base64Codec();
}

@Test
public void test_encode(){
public void test_encode() {
byte[] buffer = codec.decode(string);
String result = codec.encode(buffer);

Assert.assertEquals(string, result);
}
}
Loading

0 comments on commit 3c922b2

Please sign in to comment.