Throw IllegalStateException from afterPropertiesSet

Consistently use Assert.state in the afterPropertiesSet()
methods to throw IllegalStateException instead of
IllegalArgumentException when some properties are missing
and/or invalid.

Resolves #2244
This commit is contained in:
Danilo Piazzalunga
2022-02-07 08:17:38 +01:00
committed by Mahmoud Ben Hassine
parent b9d6e26d61
commit fc0ec01ff8
96 changed files with 188 additions and 178 deletions

View File

@@ -93,7 +93,7 @@ public abstract class KeyValueItemWriter<K, V> implements ItemWriter<V>, Initial
*/
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(itemKeyMapper, "itemKeyMapper requires a Converter type.");
Assert.state(itemKeyMapper != null, "itemKeyMapper requires a Converter type.");
init();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2018 the original author or authors.
* Copyright 2006-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@ import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.MethodInvoker;
import org.springframework.util.StringUtils;
/**
* Superclass for delegating classes which dynamically call a custom method of injected
@@ -126,8 +127,8 @@ public abstract class AbstractMethodInvokingDelegator<T> implements Initializing
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(targetObject, "targetObject must not be null");
Assert.hasLength(targetMethod, "targetMethod must not be empty");
Assert.state(targetObject != null, "targetObject must not be null");
Assert.state(StringUtils.hasText(targetMethod), "targetMethod must not be empty");
Assert.state(targetClassDeclaresTargetMethod(),
"target class must declare a method with matching name and parameter types");
}

View File

@@ -24,6 +24,7 @@ import org.springframework.batch.item.ItemWriter;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
/**
* Delegates processing to a custom method - extracts property values from item object and
@@ -62,7 +63,8 @@ public class PropertyExtractingDelegatingItemWriter<T> extends AbstractMethodInv
@Override
public void afterPropertiesSet() throws Exception {
super.afterPropertiesSet();
Assert.notEmpty(fieldsUsedAsTargetMethodArguments, "fieldsUsedAsTargetMethodArguments must not be empty");
Assert.state(!ObjectUtils.isEmpty(fieldsUsedAsTargetMethodArguments),
"fieldsUsedAsTargetMethodArguments must not be empty");
}
/**

View File

@@ -30,6 +30,7 @@ import org.springframework.data.repository.CrudRepository;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.util.MethodInvoker;
import org.springframework.util.StringUtils;
/**
* <p>
@@ -129,7 +130,7 @@ public class RepositoryItemWriter<T> implements ItemWriter<T>, InitializingBean
public void afterPropertiesSet() throws Exception {
Assert.state(repository != null, "A CrudRepository implementation is required");
if (this.methodName != null) {
Assert.hasText(this.methodName, "methodName must not be empty.");
Assert.state(StringUtils.hasText(this.methodName), "methodName must not be empty.");
}
else {
logger.debug("No method name provided, CrudRepository.saveAll will be used.");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 the original author or authors.
* Copyright 2006-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -154,7 +154,7 @@ public abstract class AbstractCursorItemReader<T> extends AbstractItemCountingIt
*/
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(dataSource, "DataSource must be provided");
Assert.state(dataSource != null, "DataSource must be provided");
}
/**

View File

@@ -91,7 +91,7 @@ public abstract class AbstractPagingItemReader<T> extends AbstractItemCountingIt
*/
@Override
public void afterPropertiesSet() throws Exception {
Assert.isTrue(pageSize > 0, "pageSize must be greater than zero");
Assert.state(pageSize > 0, "pageSize must be greater than zero");
}
@Nullable

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -316,7 +316,7 @@ public class ExtendedConnectionDataSourceProxy implements SmartDataSource, Initi
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(dataSource, "DataSource is required");
Assert.state(dataSource != null, "DataSource is required");
}
/**

View File

@@ -101,7 +101,7 @@ public class HibernateItemReaderHelper<T> implements InitializingBean {
Assert.state(sessionFactory != null, "A SessionFactory must be provided");
if (queryProvider == null) {
Assert.notNull(sessionFactory, "session factory must be set");
Assert.state(sessionFactory != null, "session factory must be set");
Assert.state(StringUtils.hasText(queryString) ^ StringUtils.hasText(queryName),
"queryString or queryName must be set");
}

View File

@@ -142,8 +142,8 @@ public class JdbcBatchItemWriter<T> implements ItemWriter<T>, InitializingBean {
*/
@Override
public void afterPropertiesSet() {
Assert.notNull(namedParameterJdbcTemplate, "A DataSource or a NamedParameterJdbcTemplate is required.");
Assert.notNull(sql, "An SQL statement is required.");
Assert.state(namedParameterJdbcTemplate != null, "A DataSource or a NamedParameterJdbcTemplate is required.");
Assert.state(sql != null, "An SQL statement is required.");
List<String> namedParameters = new ArrayList<>();
parameterCount = JdbcParameterUtils.countParameterPlaceholders(sql, namedParameters);
if (namedParameters.size() > 0) {
@@ -154,7 +154,7 @@ public class JdbcBatchItemWriter<T> implements ItemWriter<T>, InitializingBean {
usingNamedParameters = true;
}
if (!usingNamedParameters) {
Assert.notNull(itemPreparedStatementSetter,
Assert.state(itemPreparedStatementSetter != null,
"Using SQL statement with '?' placeholders requires an ItemPreparedStatementSetter");
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 the original author or authors.
* Copyright 2006-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -103,8 +103,8 @@ public class JdbcCursorItemReader<T> extends AbstractCursorItemReader<T> {
@Override
public void afterPropertiesSet() throws Exception {
super.afterPropertiesSet();
Assert.notNull(sql, "The SQL query must be provided");
Assert.notNull(rowMapper, "RowMapper must be provided");
Assert.state(sql != null, "The SQL query must be provided");
Assert.state(rowMapper != null, "RowMapper must be provided");
}
@Override

View File

@@ -155,14 +155,14 @@ public class JdbcPagingItemReader<T> extends AbstractPagingItemReader<T> impleme
@Override
public void afterPropertiesSet() throws Exception {
super.afterPropertiesSet();
Assert.notNull(dataSource, "DataSource may not be null");
Assert.state(dataSource != null, "DataSource may not be null");
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
if (fetchSize != VALUE_NOT_SET) {
jdbcTemplate.setFetchSize(fetchSize);
}
jdbcTemplate.setMaxRows(getPageSize());
namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(jdbcTemplate);
Assert.notNull(queryProvider, "QueryProvider may not be null");
Assert.state(queryProvider != null, "QueryProvider may not be null");
queryProvider.init(dataSource);
this.firstPageSql = queryProvider.generateFirstPageQuery(getPageSize());
this.remainingPagesSql = queryProvider.generateRemainingPagesQuery(getPageSize());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2020-2021 the original author or authors.
* Copyright 2020-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@ import org.springframework.beans.factory.InitializingBean;
import org.springframework.dao.DataAccessResourceFailureException;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.StringUtils;
/**
* {@link org.springframework.batch.item.ItemStreamReader} implementation based on JPA
@@ -101,9 +102,10 @@ public class JpaCursorItemReader<T> extends AbstractItemCountingItemStreamItemRe
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(this.entityManagerFactory, "EntityManagerFactory is required");
Assert.state(this.entityManagerFactory != null, "EntityManagerFactory is required");
if (this.queryProvider == null) {
Assert.hasLength(this.queryString, "Query string is required when queryProvider is null");
Assert.state(StringUtils.hasLength(this.queryString),
"Query string is required when queryProvider is null");
}
}

View File

@@ -75,7 +75,7 @@ public class JpaItemWriter<T> implements ItemWriter<T>, InitializingBean {
*/
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(entityManagerFactory, "An EntityManagerFactory is required");
Assert.state(entityManagerFactory != null, "An EntityManagerFactory is required");
}
/**

View File

@@ -31,6 +31,7 @@ import org.springframework.batch.item.database.orm.JpaQueryProvider;
import org.springframework.dao.DataAccessResourceFailureException;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.StringUtils;
/**
* <p>
@@ -144,8 +145,8 @@ public class JpaPagingItemReader<T> extends AbstractPagingItemReader<T> {
super.afterPropertiesSet();
if (queryProvider == null) {
Assert.notNull(entityManagerFactory, "EntityManager is required when queryProvider is null");
Assert.hasLength(queryString, "Query string is required when queryProvider is null");
Assert.state(entityManagerFactory != null, "EntityManager is required when queryProvider is null");
Assert.state(StringUtils.hasLength(queryString), "Query string is required when queryProvider is null");
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 the original author or authors.
* Copyright 2006-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -143,8 +143,8 @@ public class StoredProcedureItemReader<T> extends AbstractCursorItemReader<T> {
@Override
public void afterPropertiesSet() throws Exception {
super.afterPropertiesSet();
Assert.notNull(procedureName, "The name of the stored procedure must be provided");
Assert.notNull(rowMapper, "RowMapper must be provided");
Assert.state(procedureName != null, "The name of the stored procedure must be provided");
Assert.state(rowMapper != null, "RowMapper must be provided");
}
@Override

View File

@@ -69,8 +69,8 @@ public class HibernateNativeQueryProvider<E> extends AbstractHibernateQueryProvi
}
public void afterPropertiesSet() throws Exception {
Assert.isTrue(StringUtils.hasText(sqlQuery), "Native SQL query cannot be empty");
Assert.notNull(entityClass, "Entity class cannot be NULL");
Assert.state(StringUtils.hasText(sqlQuery), "Native SQL query cannot be empty");
Assert.state(entityClass != null, "Entity class cannot be NULL");
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2020-2021 the original author or authors.
* Copyright 2020-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -57,8 +57,8 @@ public class JpaNamedQueryProvider<E> extends AbstractJpaQueryProvider {
@Override
public void afterPropertiesSet() throws Exception {
Assert.isTrue(StringUtils.hasText(this.namedQuery), "Named query cannot be empty");
Assert.notNull(this.entityClass, "Entity class cannot be NULL");
Assert.state(StringUtils.hasText(this.namedQuery), "Named query cannot be empty");
Assert.state(this.entityClass != null, "Entity class cannot be NULL");
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 the original author or authors.
* Copyright 2006-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -53,8 +53,8 @@ public class JpaNativeQueryProvider<E> extends AbstractJpaQueryProvider {
@Override
public void afterPropertiesSet() throws Exception {
Assert.isTrue(StringUtils.hasText(sqlQuery), "Native SQL query cannot be empty");
Assert.notNull(entityClass, "Entity class cannot be NULL");
Assert.state(StringUtils.hasText(sqlQuery), "Native SQL query cannot be empty");
Assert.state(entityClass != null, "Entity class cannot be NULL");
}
}

View File

@@ -286,7 +286,7 @@ public class FlatFileItemReader<T> extends AbstractItemCountingItemStreamItemRea
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(lineMapper, "LineMapper is required");
Assert.state(lineMapper != null, "LineMapper is required");
}
@Override

View File

@@ -56,7 +56,7 @@ public class FlatFileItemWriter<T> extends AbstractFileItemWriter<T> {
*/
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(lineAggregator, "A LineAggregator must be provided.");
Assert.state(lineAggregator != null, "A LineAggregator must be provided.");
if (append) {
shouldDeleteIfExists = false;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2007 the original author or authors.
* Copyright 2006-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -52,8 +52,8 @@ public class DefaultLineMapper<T> implements LineMapper<T>, InitializingBean {
@Override
public void afterPropertiesSet() {
Assert.notNull(tokenizer, "The LineTokenizer must be set");
Assert.notNull(fieldSetMapper, "The FieldSetMapper must be set");
Assert.state(tokenizer != null, "The LineTokenizer must be set");
Assert.state(fieldSetMapper != null, "The FieldSetMapper must be set");
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2007 the original author or authors.
* Copyright 2006-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -68,7 +68,7 @@ public class PatternMatchingCompositeLineMapper<T> implements LineMapper<T>, Ini
@Override
public void afterPropertiesSet() throws Exception {
this.tokenizer.afterPropertiesSet();
Assert.isTrue(this.patternMatcher != null, "The 'patternMatcher' property must be non-null");
Assert.state(this.patternMatcher != null, "The 'patternMatcher' property must be non-null");
}
public void setTokenizers(Map<String, LineTokenizer> tokenizers) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2007 the original author or authors.
* Copyright 2006-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -60,7 +60,7 @@ public class BeanWrapperFieldExtractor<T> implements FieldExtractor<T>, Initiali
@Override
public void afterPropertiesSet() {
Assert.notNull(names, "The 'names' property must be set.");
Assert.state(names != null, "The 'names' property must be set.");
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2020 the original author or authors.
* Copyright 2006-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -274,7 +274,7 @@ public class DelimitedLineTokenizer extends AbstractLineTokenizer implements Ini
@Override
public void afterPropertiesSet() throws Exception {
Assert.hasLength(this.delimiter, "A delimiter is required");
Assert.state(StringUtils.hasLength(this.delimiter), "A delimiter is required");
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2019 the original author or authors.
* Copyright 2006-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -56,7 +56,7 @@ public class PatternMatchingCompositeLineTokenizer implements LineTokenizer, Ini
*/
@Override
public void afterPropertiesSet() throws Exception {
Assert.isTrue(this.tokenizers != null, "The 'tokenizers' property must be non-empty");
Assert.state(this.tokenizers != null, "The 'tokenizers' property must be non-empty");
}
public void setTokenizers(Map<String, LineTokenizer> tokenizers) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 the original author or authors.
* Copyright 2006-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -90,7 +90,7 @@ public class JmsItemReader<T> implements ItemReader<T>, InitializingBean {
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(this.jmsTemplate, "The 'jmsTemplate' is required.");
Assert.state(this.jmsTemplate != null, "The 'jmsTemplate' is required.");
}
}

View File

@@ -72,8 +72,8 @@ public class KafkaItemWriter<K, T> extends KeyValueItemWriter<K, T> {
@Override
protected void init() {
Assert.notNull(this.kafkaTemplate, "KafkaTemplate must not be null.");
Assert.notNull(this.kafkaTemplate.getDefaultTopic(), "KafkaTemplate must have the default topic set.");
Assert.state(this.kafkaTemplate != null, "KafkaTemplate must not be null.");
Assert.state(this.kafkaTemplate.getDefaultTopic() != null, "KafkaTemplate must have the default topic set.");
}
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2019 the original author or authors.
* Copyright 2005-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -175,8 +175,8 @@ public class LdifReader extends AbstractItemCountingItemStreamItemReader<LdapAtt
}
public void afterPropertiesSet() throws Exception {
Assert.notNull(resource, "A resource is required to parse.");
Assert.notNull(ldifParser, "A parser is required");
Assert.state(resource != null, "A resource is required to parse.");
Assert.state(ldifParser != null, "A parser is required");
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2019 the original author or authors.
* Copyright 2005-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -172,8 +172,8 @@ public class MappingLdifReader<T> extends AbstractItemCountingItemStreamItemRead
}
public void afterPropertiesSet() throws Exception {
Assert.notNull(resource, "A resource is required to parse.");
Assert.notNull(ldifParser, "A parser is required");
Assert.state(resource != null, "A resource is required to parse.");
Assert.state(ldifParser != null, "A parser is required");
}
}

View File

@@ -93,8 +93,8 @@ public class CompositeItemProcessor<I, O> implements ItemProcessor<I, O>, Initia
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(delegates, "The 'delegates' may not be null");
Assert.notEmpty(delegates, "The 'delegates' may not be empty");
Assert.state(delegates != null, "The 'delegates' may not be null");
Assert.state(!delegates.isEmpty(), "The 'delegates' may not be empty");
}
/**

View File

@@ -88,8 +88,8 @@ public class CompositeItemWriter<T> implements ItemStreamWriter<T>, Initializing
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(delegates, "The 'delegates' may not be null");
Assert.notEmpty(delegates, "The 'delegates' may not be empty");
Assert.state(delegates != null, "The 'delegates' may not be null");
Assert.state(!delegates.isEmpty(), "The 'delegates' may not be empty");
}
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2021 the original author or authors.
* Copyright 2014-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -139,7 +139,7 @@ public class ScriptItemProcessor<I, O> implements ItemProcessor<I, O>, Initializ
"Either a script source or script file must be provided, not both");
if (scriptSource != null && scriptEvaluator instanceof StandardScriptEvaluator) {
Assert.isTrue(StringUtils.hasLength(language),
Assert.state(StringUtils.hasLength(language),
"Language must be provided when using the default ScriptEvaluator and raw source code");
((StandardScriptEvaluator) scriptEvaluator).setLanguage(language);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2019 the original author or authors.
* Copyright 2015-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -71,7 +71,7 @@ public class SynchronizedItemStreamReader<T> implements ItemStreamReader<T>, Ini
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(this.delegate, "A delegate item reader is required");
Assert.state(this.delegate != null, "A delegate item reader is required");
}
}

View File

@@ -82,7 +82,7 @@ public class SynchronizedItemStreamWriter<T> implements ItemStreamWriter<T>, Ini
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(this.delegate, "A delegate item writer is required");
Assert.state(this.delegate != null, "A delegate item writer is required");
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2007 the original author or authors.
* Copyright 2006-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -85,7 +85,7 @@ public class SpringValidator<T> implements Validator<T>, InitializingBean {
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(validator, "validator must be set");
Assert.state(validator != null, "validator must be set");
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2019 the original author or authors.
* Copyright 2006-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -91,7 +91,7 @@ public class ValidatingItemProcessor<T> implements ItemProcessor<T, T>, Initiali
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(validator, "Validator must not be null.");
Assert.state(validator != null, "Validator must not be null.");
}
}

View File

@@ -160,10 +160,10 @@ public class StaxEventItemReader<T> extends AbstractItemCountingItemStreamItemRe
*/
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(unmarshaller, "The Unmarshaller must not be null.");
Assert.notEmpty(fragmentRootElementNames, "The FragmentRootElementNames must not be empty");
Assert.state(unmarshaller != null, "The Unmarshaller must not be null.");
Assert.state(!fragmentRootElementNames.isEmpty(), "The FragmentRootElementNames must not be empty");
for (QName fragmentRootElementName : fragmentRootElementNames) {
Assert.hasText(fragmentRootElementName.getLocalPart(),
Assert.state(StringUtils.hasText(fragmentRootElementName.getLocalPart()),
"The FragmentRootElementNames must not contain empty elements");
}
}

View File

@@ -367,7 +367,7 @@ public class StaxEventItemWriter<T> extends AbstractItemStreamItemWriter<T>
*/
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(marshaller, "A Marshaller is required");
Assert.state(marshaller != null, "A Marshaller is required");
if (rootTagName.contains("{")) {
rootTagNamespace = rootTagName.replaceAll("\\{(.*)\\}.*", "$1");
rootTagName = rootTagName.replaceAll("\\{.*\\}(.*)", "$1");