diff --git a/eclipse-formatting.xml b/eclipse-formatting.xml
new file mode 100644
index 000000000..c74468778
--- /dev/null
+++ b/eclipse-formatting.xml
@@ -0,0 +1,291 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/org/springframework/data/cassandra/config/AbstractCassandraConfiguration.java b/src/main/java/org/springframework/data/cassandra/config/AbstractCassandraConfiguration.java
index 56a2ce9c8..738514b39 100644
--- a/src/main/java/org/springframework/data/cassandra/config/AbstractCassandraConfiguration.java
+++ b/src/main/java/org/springframework/data/cassandra/config/AbstractCassandraConfiguration.java
@@ -53,7 +53,7 @@ public abstract class AbstractCassandraConfiguration {
* @return must not be {@literal null}.
*/
protected abstract String getKeyspaceName();
-
+
/**
* Return the {@link Cluster} instance to connect to.
*
@@ -62,10 +62,10 @@ public abstract class AbstractCassandraConfiguration {
*/
@Bean
public abstract Cluster cluster() throws Exception;
-
+
/**
- * Creates a {@link Session} to be used by the {@link Keyspace}. Will use the {@link Cluster} instance
- * configured in {@link #cluster()}.
+ * Creates a {@link Session} to be used by the {@link Keyspace}. Will use the {@link Cluster} instance configured in
+ * {@link #cluster()}.
*
* @see #cluster()
* @see #Keyspace()
@@ -77,12 +77,11 @@ public abstract class AbstractCassandraConfiguration {
String keyspace = getKeyspaceName();
if (StringUtils.hasText(keyspace)) {
return cluster().connect(keyspace);
- }
- else {
+ } else {
return cluster().connect();
}
}
-
+
/**
* Creates a {@link Keyspace} to be used by the {@link CassandraTemplate}. Will use the {@link Session} instance
* configured in {@link #session()} and {@link CassandraConverter} configured in {@link #converter()}.
@@ -96,9 +95,10 @@ public abstract class AbstractCassandraConfiguration {
public Keyspace keyspace() throws Exception {
return new Keyspace(getKeyspaceName(), session(), converter());
}
+
/**
- * Return the base package to scan for mapped {@link Table}s. Will return the package name of the configuration
- * class' (the concrete class, not this one here) by default. So if you have a {@code com.acme.AppConfig} extending
+ * Return the base package to scan for mapped {@link Table}s. Will return the package name of the configuration class'
+ * (the concrete class, not this one here) by default. So if you have a {@code com.acme.AppConfig} extending
* {@link AbstractCassandraConfiguration} the base package will be considered {@code com.acme} unless the method is
* overriden to implement alternate behaviour.
*
@@ -108,7 +108,7 @@ public abstract class AbstractCassandraConfiguration {
protected String getMappingBasePackage() {
return getClass().getPackage().getName();
}
-
+
/**
* Creates a {@link CassandraTemplate}.
*
@@ -119,7 +119,7 @@ public abstract class AbstractCassandraConfiguration {
public CassandraTemplate cassandraTemplate() throws Exception {
return new CassandraTemplate(keyspace());
}
-
+
/**
* Return the {@link MappingContext} instance to map Entities to properties.
*
@@ -130,7 +130,7 @@ public abstract class AbstractCassandraConfiguration {
public MappingContext extends CassandraPersistentEntity>, CassandraPersistentProperty> mappingContext() {
return new CassandraMappingContext();
}
-
+
/**
* Return the {@link CassandraConverter} instance to convert Rows to Objects.
*
@@ -141,7 +141,7 @@ public abstract class AbstractCassandraConfiguration {
public CassandraConverter converter() {
return new MappingCassandraConverter(mappingContext());
}
-
+
/**
* Scans the mapping base package for classes annotated with {@link Table}.
*
@@ -168,5 +168,5 @@ public abstract class AbstractCassandraConfiguration {
return initialEntitySet;
}
-
+
}
diff --git a/src/main/java/org/springframework/data/cassandra/config/CassandraClusterParser.java b/src/main/java/org/springframework/data/cassandra/config/CassandraClusterParser.java
index 246071fe8..1718a283f 100644
--- a/src/main/java/org/springframework/data/cassandra/config/CassandraClusterParser.java
+++ b/src/main/java/org/springframework/data/cassandra/config/CassandraClusterParser.java
@@ -35,7 +35,7 @@ import org.w3c.dom.Element;
* @author Alex Shvid
*/
-public class CassandraClusterParser extends AbstractSimpleBeanDefinitionParser {
+public class CassandraClusterParser extends AbstractSimpleBeanDefinitionParser {
@Override
protected Class> getBeanClass(Element element) {
@@ -55,27 +55,26 @@ public class CassandraClusterParser extends AbstractSimpleBeanDefinitionParser
}
@Override
- protected void doParse(Element element, ParserContext parserContext,
- BeanDefinitionBuilder builder) {
-
+ protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
+
String contactPoints = element.getAttribute("contactPoints");
if (StringUtils.hasText(contactPoints)) {
builder.addPropertyValue("contactPoints", contactPoints);
}
-
+
String port = element.getAttribute("port");
if (StringUtils.hasText(port)) {
builder.addPropertyValue("port", port);
}
-
+
String compression = element.getAttribute("compression");
if (StringUtils.hasText(compression)) {
builder.addPropertyValue("compressionType", CompressionType.valueOf(compression));
}
-
+
postProcess(builder, element);
}
-
+
@Override
protected void postProcess(BeanDefinitionBuilder builder, Element element) {
List subElements = DomUtils.getChildElements(element);
@@ -86,17 +85,15 @@ public class CassandraClusterParser extends AbstractSimpleBeanDefinitionParser
if ("local-pooling-options".equals(name)) {
builder.addPropertyValue("localPoolingOptions", parsePoolingOptions(subElement));
- }
- else if ("remote-pooling-options".equals(name)) {
+ } else if ("remote-pooling-options".equals(name)) {
builder.addPropertyValue("remotePoolingOptions", parsePoolingOptions(subElement));
- }
- else if ("socket-options".equals(name)) {
+ } else if ("socket-options".equals(name)) {
builder.addPropertyValue("socketOptions", parseSocketOptions(subElement));
}
}
-
- }
-
+
+ }
+
private BeanDefinition parsePoolingOptions(Element element) {
BeanDefinitionBuilder defBuilder = BeanDefinitionBuilder.genericBeanDefinition(PoolingOptionsConfig.class);
ParsingUtils.setPropertyValue(defBuilder, element, "min-simultaneous-requests", "minSimultaneousRequests");
@@ -104,8 +101,8 @@ public class CassandraClusterParser extends AbstractSimpleBeanDefinitionParser
ParsingUtils.setPropertyValue(defBuilder, element, "core-connections", "coreConnections");
ParsingUtils.setPropertyValue(defBuilder, element, "max-connections", "maxConnections");
return defBuilder.getBeanDefinition();
- }
-
+ }
+
private BeanDefinition parseSocketOptions(Element element) {
BeanDefinitionBuilder defBuilder = BeanDefinitionBuilder.genericBeanDefinition(SocketOptionsConfig.class);
ParsingUtils.setPropertyValue(defBuilder, element, "connect-timeout-mls", "connectTimeoutMls");
@@ -116,6 +113,6 @@ public class CassandraClusterParser extends AbstractSimpleBeanDefinitionParser
ParsingUtils.setPropertyValue(defBuilder, element, "receive-buffer-size", "receiveBufferSize");
ParsingUtils.setPropertyValue(defBuilder, element, "send-buffer-size", "sendBufferSize");
return defBuilder.getBeanDefinition();
- }
+ }
}
diff --git a/src/main/java/org/springframework/data/cassandra/config/CassandraKeyspaceParser.java b/src/main/java/org/springframework/data/cassandra/config/CassandraKeyspaceParser.java
index 5b34d561d..a9a724452 100644
--- a/src/main/java/org/springframework/data/cassandra/config/CassandraKeyspaceParser.java
+++ b/src/main/java/org/springframework/data/cassandra/config/CassandraKeyspaceParser.java
@@ -36,8 +36,7 @@ import org.w3c.dom.Element;
* @author Alex Shvid
*/
-
-public class CassandraKeyspaceParser extends AbstractSimpleBeanDefinitionParser {
+public class CassandraKeyspaceParser extends AbstractSimpleBeanDefinitionParser {
@Override
protected Class> getBeanClass(Element element) {
@@ -55,16 +54,15 @@ public class CassandraKeyspaceParser extends AbstractSimpleBeanDefinitionParser
String id = super.resolveId(element, definition, parserContext);
return StringUtils.hasText(id) ? id : BeanNames.CASSANDRA_KEYSPACE;
}
-
+
@Override
- protected void doParse(Element element, ParserContext parserContext,
- BeanDefinitionBuilder builder) {
-
+ protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
+
String name = element.getAttribute("name");
if (StringUtils.hasText(name)) {
builder.addPropertyValue("keyspace", name);
}
-
+
String clusterRef = element.getAttribute("cassandra-cluster-ref");
if (!StringUtils.hasText(clusterRef)) {
clusterRef = BeanNames.CASSANDRA_CLUSTER;
@@ -78,7 +76,7 @@ public class CassandraKeyspaceParser extends AbstractSimpleBeanDefinitionParser
postProcess(builder, element);
}
-
+
@Override
protected void postProcess(BeanDefinitionBuilder builder, Element element) {
List subElements = DomUtils.getChildElements(element);
@@ -86,28 +84,28 @@ public class CassandraKeyspaceParser extends AbstractSimpleBeanDefinitionParser
// parse nested elements
for (Element subElement : subElements) {
String name = subElement.getLocalName();
-
+
if ("keyspace-attributes".equals(name)) {
builder.addPropertyValue("keyspaceAttributes", parseKeyspaceAttributes(subElement));
}
}
-
- }
-
+
+ }
+
private BeanDefinition parseKeyspaceAttributes(Element element) {
BeanDefinitionBuilder defBuilder = BeanDefinitionBuilder.genericBeanDefinition(KeyspaceAttributes.class);
ParsingUtils.setPropertyValue(defBuilder, element, "auto", "auto");
ParsingUtils.setPropertyValue(defBuilder, element, "replication-strategy", "replicationStrategy");
ParsingUtils.setPropertyValue(defBuilder, element, "replication-factor", "replicationFactor");
ParsingUtils.setPropertyValue(defBuilder, element, "durable-writes", "durableWrites");
-
+
List subElements = DomUtils.getChildElements(element);
ManagedList