Skip to content

Commit

Permalink
Some docs clean up for ZK & XML modules
Browse files Browse the repository at this point in the history
  • Loading branch information
artembilan committed Nov 15, 2021
1 parent 6f3fdc7 commit f5f1c82
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@
import java.util.List;

/**
* The validation exception which aggregate all the XML validation errors.
*
* @author Oleg Zhurakousky
* @author Artem Bilan
*
* @since 2.0
*/
@SuppressWarnings("serial")
Expand All @@ -31,7 +34,7 @@ public class AggregatedXmlMessageValidationException extends RuntimeException {


public AggregatedXmlMessageValidationException(List<Throwable> exceptions) {
this.exceptions = (exceptions != null) ? exceptions : Collections.<Throwable>emptyList();
this.exceptions = (exceptions != null) ? exceptions : Collections.emptyList();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
import org.springframework.xml.validation.XmlValidatorFactory;

/**
* The XML validation-specific {@link MessageSelector}.
*
* @author Oleg Zhurakousky
* @author Gary Russell
* @author Liujiong
Expand Down Expand Up @@ -74,7 +76,7 @@ public String getUrl() {


/**
* Creates a selector with a default {@link XmlValidator}. The validator will be initialized with
* Create a selector with a default {@link XmlValidator}. The validator will be initialized with
* the provided 'schema' location {@link Resource} and 'schemaType'. The valid options for schema
* type are {@link XmlValidatorFactory#SCHEMA_W3C_XML} or {@link XmlValidatorFactory#SCHEMA_RELAX_NG}.
* If no 'schemaType' is provided it will default to {@link XmlValidatorFactory#SCHEMA_W3C_XML};
Expand Down Expand Up @@ -133,8 +135,10 @@ public boolean accept(Message<?> message) {
new AggregatedXmlMessageValidationException(Arrays.asList(validationExceptions)));
}
else {
LOGGER.info(new AggregatedXmlMessageValidationException(Arrays.asList(validationExceptions)),
exceptionMessage);
if (LOGGER.isInfoEnabled()) {
LOGGER.info(new AggregatedXmlMessageValidationException(Arrays.asList(validationExceptions)),
exceptionMessage);
}
}
}
return validationSuccess;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.springframework.util.StringUtils;

/**
* super class for XmlTransformer
* Super class for XML transformers.
*
* @author Jonas Partner
* @author Mark Fisher
Expand Down Expand Up @@ -73,7 +73,8 @@ public ResultFactory getResultFactory() {
@Override
protected void onInit() {
super.onInit();
ResultFactory generatedResultFactory = configureResultFactory(this.resultType, this.resultFactoryName, this.getBeanFactory());
ResultFactory generatedResultFactory =
configureResultFactory(this.resultType, this.resultFactoryName, getBeanFactory());
if (generatedResultFactory != null) {
this.resultFactory = generatedResultFactory;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
* @author Mark Fisher
* @author Jonas Partner
* @author Gary Russell
* @author Artem Bilan
*/
public class MarshallingTransformer extends AbstractXmlTransformer {

Expand All @@ -44,13 +45,13 @@ public class MarshallingTransformer extends AbstractXmlTransformer {
private volatile boolean extractPayload = true;


public MarshallingTransformer(Marshaller marshaller, ResultTransformer resultTransformer) throws ParserConfigurationException {
public MarshallingTransformer(Marshaller marshaller, ResultTransformer resultTransformer) {
Assert.notNull(marshaller, "a marshaller is required");
this.marshaller = marshaller;
this.resultTransformer = resultTransformer;
}

public MarshallingTransformer(Marshaller marshaller) throws ParserConfigurationException {
public MarshallingTransformer(Marshaller marshaller) {
this(marshaller, null);
}

Expand All @@ -59,7 +60,6 @@ public MarshallingTransformer(Marshaller marshaller) throws ParserConfigurationE
* Specify whether the source Message's payload should be extracted prior
* to marshalling. This value is set to "true" by default. To send the
* Message itself as input to the Marshaller instead, set this to "false".
*
* @param extractPayload true if the payload should be extracted.
*/
public void setExtractPayload(boolean extractPayload) {
Expand All @@ -75,8 +75,8 @@ public String getComponentType() {
@Override
public Object doTransform(Message<?> message) {
Object source = (this.extractPayload) ? message.getPayload() : message;
Object transformedPayload = null;
Result result = this.getResultFactory().createResult(source);
Object transformedPayload;
Result result = getResultFactory().createResult(source);
if (result == null) {
throw new MessagingException(
"Unable to marshal payload, ResultFactory returned null.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
import org.springframework.xml.xpath.XPathExpressionFactory;

/**
* The xPath-specific {@link HeaderValueMessageProcessor}
*
* @author Jonas Partner
* @author Mark Fisher
* @author Artem Bilan
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
/**
* Enumeration of different types of XPath evaluation used to indicate the type
* of evaluation that should be carried out using a provided XPath expression.
*
* @author Mark Fisher
* @author Jonas Partner
*/
public enum XPathEvaluationType {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* Provides classes related to configuration.
*/
package org.springframework.integration.zookeeper.config;
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ public ZookeeperLockRegistry(CuratorFramework client, KeyToPathStrategy keyToPat
* used internally, an external executor may be required in some environments, for
* example those that require the use of a {@code WorkManagerTaskExecutor}.
* @param mutexTaskExecutor the executor.
*
* @since 4.2.10
*/
public void setMutexTaskExecutor(AsyncTaskExecutor mutexTaskExecutor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
package org.springframework.integration.zookeeper.metadata;

/**
* A {@code ZookeeperMetadataStore}-specific exception.
*
* @author Marius Bogoevici
* @author Artem Bilan
*
* @since 4.2
*/
@SuppressWarnings("serial")
Expand Down

0 comments on commit f5f1c82

Please sign in to comment.