Skip to content
Permalink
Browse files

added and applied code formatting rules

  • Loading branch information...
DirkMahler committed Mar 3, 2019
1 parent 6311e76 commit e39d05f79565a3552c33d9ca81f397caa56180dc
Showing 315 changed files with 2,457 additions and 1,744 deletions.
@@ -7,6 +7,6 @@ end_of_line = lf
insert_final_newline = true
indent_style = space

[*.{java,xml}]
[*.{java, xml}]
indent_size = 4
trim_trailing_whitespace = true
@@ -1,4 +1,5 @@
<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">
<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>
<parent>
<groupId>com.buschmais.xo</groupId>
@@ -1,31 +1,36 @@
package com.buschmais.xo.api;

/**
* Defines an interface which is transparently implemented by all composite instances created by the {@link XOManager}.
* Defines an interface which is transparently implemented by all composite
* instances created by the {@link XOManager}.
*/
public interface CompositeObject {

/**
* Return the id of the object.
*
* @param <I> The id type.
* @param <I>
* The id type.
* @return The id of the object.
*/
<I> I getId();

/**
* Cast the instance to a specific type.
*
* @param type The type.
* @param <T> The type.
* @param type
* The type.
* @param <T>
* The type.
* @return The instance.
*/
<T> T as(Class<T> type);

/**
* Return the underlying datastore delegate.
*
* @param <D> The expected type.
* @param <D>
* The expected type.
* @return The datastore delegate.
*/
<D> D getDelegate();
@@ -4,6 +4,5 @@
* Created by dimahler on 1/14/14.
*/
public enum ConcurrencyMode {
SINGLETHREADED,
MULTITHREADED;
SINGLETHREADED, MULTITHREADED;
}
@@ -1,9 +1,11 @@
package com.buschmais.xo.api;

/**
* An example to be used for {@link com.buschmais.xo.api.XOManager#find(Example, Class)}.
* An example to be used for
* {@link com.buschmais.xo.api.XOManager#find(Example, Class)}.
*
* @param <T> The type to be prepared.
* @param <T>
* The type to be prepared.
*/
@FunctionalInterface
public interface Example<T> {
@@ -47,8 +47,8 @@
* Set the flush behavior.
*
* @param flush
* if <code>true</code> any modified instances will be flushed to
* the datastore before executing the query.
* if <code>true</code> any modified instances will be flushed to the
* datastore before executing the query.
*/
Query<T> flush(boolean flush);

@@ -71,9 +71,8 @@
void close();

/**
* Defines the interface which is implemented by all instances contained
* in a {@link ResultIterable} and which allows access to a column in a
* row.
* Defines the interface which is implemented by all instances contained in a
* {@link ResultIterable} and which allows access to a column in a row.
*/
interface CompositeRowObject extends CompositeObject {

@@ -3,13 +3,17 @@
/**
* An {@link Iterable} which allows retrieving a single result.
*
* @param <T> The type returned by the {@link Iterable}.
* @param <T>
* The type returned by the {@link Iterable}.
*/
public interface ResultIterable<T> extends Iterable<T> {

/**
* Return a single result.
* <p>A {@link XOException} is thrown if no or more than element is returned by the {@link Iterable}.</p>
* <p>
* A {@link XOException} is thrown if no or more than element is returned by the
* {@link Iterable}.
* </p>
*
* @return The single result.
*/
@@ -4,9 +4,11 @@
import java.util.Iterator;

/**
* An {@link Iterator} which extends {@link AutoCloseable} and {@link Closeable}.
* An {@link Iterator} which extends {@link AutoCloseable} and
* {@link Closeable}.
*
* @param <T> The type returned by the {@link Iterator}.
* @param <T>
* The type returned by the {@link Iterator}.
*/
public interface ResultIterator<T> extends Iterator<T>, AutoCloseable, Closeable {

@@ -8,7 +8,7 @@
/**
* Defines the annotation to be used for declarative transaction demarcation.
*/
@Target({ElementType.METHOD})
@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface Transaction {

@@ -29,11 +29,13 @@
*/
NONE,
/**
* An existing transaction is mandatory, i.e. the application explicitly controls transactions.
* An existing transaction is mandatory, i.e. the application explicitly
* controls transactions.
*/
MANDATORY,
/**
* An existing transaction will be used, if no transaction exists a new one will be automatically created and committed.
* An existing transaction will be used, if no transaction exists a new one will
* be automatically created and committed.
*/
REQUIRES,
/**
@@ -5,11 +5,13 @@
*/
public enum ValidationMode {
/**
* No validation will be performed. The application must explicitly call {@link XOManager#validate()}.
* No validation will be performed. The application must explicitly call
* {@link XOManager#validate()}.
*/
NONE,
/**
* Instance will be automatically validated when instance are flushed to the datastore.
* Instance will be automatically validated when instance are flushed to the
* datastore.
*/
AUTO;
}
@@ -8,7 +8,8 @@
/**
* Constructor.
*
* @param message The message.
* @param message
* The message.
*/
public XOException(String message) {
super(message);
@@ -17,8 +18,10 @@ public XOException(String message) {
/**
* Constructor.
*
* @param message The message.
* @param cause The cause.
* @param message
* The message.
* @param cause
* The cause.
*/
public XOException(String message, Throwable cause) {
super(message, cause);
@@ -16,8 +16,8 @@
/**
* Return the {@link XOTransaction} associated with the manager.
*
* @return The {@link XOTransaction} or <code>null</code> if the datastore
* does not support transactions.
* @return The {@link XOTransaction} or <code>null</code> if the datastore does
* not support transactions.
*/
@Transaction(NOT_SUPPORTED)
XOTransaction currentTransaction();
@@ -91,7 +91,7 @@
* The {@link Example}.
* @return An {@link Iterable} returning the property instance.
*/
<T> ResultIterable<T> find( Class<T> type, Example<T> example);
<T> ResultIterable<T> find(Class<T> type, Example<T> example);

/**
* Create a new {@link CompositeObject} instance.
@@ -108,8 +108,8 @@
* Create a new property instance.
*
* @param <T>
* The expected return type. Note that it must be assignable to
* at least one of the interfaces specified for the types.
* The expected return type. Note that it must be assignable to at
* least one of the interfaces specified for the types.
* @param type
* The interface the property type shall implement.
* @return The property instance.
@@ -295,8 +295,8 @@
void clear();

/**
* Register an instance listener containing life cycle methods (e.g.
* annotated with {@link com.buschmais.xo.api.annotation.PostCreate}.
* Register an instance listener containing life cycle methods (e.g. annotated
* with {@link com.buschmais.xo.api.annotation.PostCreate}.
*
* @param instanceListener
* The instance listener.
@@ -7,26 +7,26 @@
* The type of the instance to migrate.
*/
public interface XOMigrator<T> {
/**
* Add a type to the instance.
*
* @param newType
* The new type.
* @param newTypes
* The new types.
* @return A new instance representing the original types and the given new
* types.
*/
CompositeObject add(Class<?> newType, Class<?>... newTypes);
/**
* Add a type to the instance.
*
* @param newType
* The new type.
* @param newTypes
* The new types.
* @return A new instance representing the original types and the given new
* types.
*/
CompositeObject add(Class<?> newType, Class<?>... newTypes);

/**
* Remove a type from the instance.
*
* @param obsoleteType
* The obsolete type.
* @param obsoleteTypes
* The obsolete types.
* @return A new instance without the obsolete types.
*/
CompositeObject remove(Class<?> obsoleteType, Class<?>... obsoleteTypes);
/**
* Remove a type from the instance.
*
* @param obsoleteType
* The obsolete type.
* @param obsoleteTypes
* The obsolete types.
* @return A new instance without the obsolete types.
*/
CompositeObject remove(Class<?> obsoleteType, Class<?>... obsoleteTypes);
}
@@ -54,17 +54,17 @@
void setRollbackOnly();

/**
* Close the transaction, i.e. commit the transaction if it has not been
* marked for rollback, perform rollback otherwise.
* Close the transaction, i.e. commit the transaction if it has not been marked
* for rollback, perform rollback otherwise.
*/
@Override
void close();

/**
* Returns if the current transaction is marked as rollback only.
*
* @return <code>true</code> if the current transaction is marked as
* rollback only.
* @return <code>true</code> if the current transaction is marked as rollback
* only.
*/
boolean isRollbackOnly();

@@ -1,13 +1,11 @@
package com.buschmais.xo.api.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
* Declares a type as final, i.e. it is not possible to extend from it or create
* composite instances with other types.
@@ -1,12 +1,12 @@
package com.buschmais.xo.api.annotation;

import com.buschmais.xo.api.proxy.ProxyMethod;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import com.buschmais.xo.api.proxy.ProxyMethod;

/**
* Adds a custom implementation to any method of a composite object.
*/
@@ -6,7 +6,8 @@
import java.lang.annotation.Target;

/**
* Defines an method which will execute the given query with the specified parameter values.
* Defines an method which will execute the given query with the specified
* parameter values.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@@ -18,7 +19,8 @@
Class<?> query() default Object.class;

/**
* @return The name of the parameter passed to the query representing the containing instance ("this").
* @return The name of the parameter passed to the query representing the
* containing instance ("this").
*/
String usingThisAs() default "this";

Oops, something went wrong.

0 comments on commit e39d05f

Please sign in to comment.
You can’t perform that action at this time.