* @author m.venin
* @since 2010
*/
-public abstract class AbstractCategoricalDescriptionBuilder extends DescriptionBuilder<CategoricalData>{
+public abstract class AbstractCategoricalDescriptionBuilder
+ extends DescriptionBuilder<CategoricalData>{
@Override
public TextData build(CategoricalData data, List<Language> languages) {
* @author m.venin
* @since 2010
*/
-public class MicroFormatCategoricalDescriptionBuilder extends AbstractCategoricalDescriptionBuilder{
+public class MicroFormatCategoricalDescriptionBuilder
+ extends AbstractCategoricalDescriptionBuilder{
private final String spanEnd = "</span>";
*\r
* The contents of this file are subject to the Mozilla Public License Version 1.1\r
* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/ \r
+*/\r
\r
package eu.etaxonomy.cdm.jaxb;\r
\r
\r
@SuppressWarnings("unused")\r
private static final Log logger = LogFactory.getLog(FormattedTextAdapter.class);\r
- \r
- public FormattedText marshal(String string) throws Exception {\r
+\r
+ @Override\r
+ public FormattedText marshal(String string) throws Exception {\r
if(string != null) {\r
string = StringEscapeUtils.escapeXml(string);\r
String documentString = "<?xml version=\"1.0\"?><text>" + string + "</text>";\r
Node node = childNodes.item(i);\r
if(node instanceof org.w3c.dom.Text ) {\r
org.w3c.dom.Text textNode = (org.w3c.dom.Text) node;\r
- \r
+\r
text.getContent().add(textNode.getTextContent());\r
} else {\r
text.getContent().add(node);\r
return null;\r
}\r
\r
- public String unmarshal(FormattedText text) throws Exception {\r
+ @Override\r
+ public String unmarshal(FormattedText text) throws Exception {\r
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\r
Document document = factory.newDocumentBuilder().newDocument();\r
DocumentFragment documentFragment = document.createDocumentFragment();\r
- \r
+\r
for(Object object : text.getContent()) {\r
if(object instanceof String) {\r
String string = (String)object;\r
throw de;\r
}\r
}\r
- \r
+\r
}\r
\r
documentFragment.appendChild(document.importNode(node,true));\r
TransformerFactory transformerFactory = TransformerFactory.newInstance();\r
Transformer transformer = transformerFactory.newTransformer();\r
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION , "yes");\r
- \r
+\r
Source input = new DOMSource(documentFragment);\r
StringWriter stringWriter = new StringWriter();\r
Result output = new StreamResult(stringWriter);\r
return result;
}
- /**
- * {@inheritDoc}
- */
@Override
public boolean isHybridName() {
return this.isMonomHybrid() || this.isBinomHybrid() || this.isTrinomHybrid();
}
- /**
- * {@inheritDoc}
- */
@Override
public boolean isHybrid() {
return this.isHybridName() || this.isHybridFormula();
this.setNameCache(oldNameCache, isProtected);
}
-
// Compare name cache of taxon names
if (CdmUtils.isNotBlank(otherNameCache) && CdmUtils.isNotBlank(thisNameCache)) {
thisNameCache = normalizeName(thisNameCache);
static final String HYBRID_SIGN = UTF8.HYBRID.toString();
static final String QUOT_SIGN = "[\\u02BA\\u0022\\u0022]";
- /**
- * @param thisNameCache
- * @param HYBRID_SIGN
- * @param QUOT_SIGN
- * @return
- */
private String normalizeName(String thisNameCache) {
thisNameCache = thisNameCache.replaceAll(HYBRID_SIGN, "");
thisNameCache = thisNameCache.replaceAll(QUOT_SIGN, "");
//************************ isType ***********************************************/
- /**
- * @return
- */
@Override
public boolean isNonViral() {
return nameType.isNonViral();
}
-
@Override
public boolean isZoological(){
return nameType.isZoological();
return false;
}
-
- /**
- * @return
- */
private boolean updateFullTitleCache() {
if (protectedFullTitleCache == false){
String oldCache = this.fullTitleCache;
return false;
}
-
//*********************** CLONE ********************************************************/
/**
result.status.add(newStatus);
}
-
//to relations
result.relationsToThisName = new HashSet<>();
for (NameRelationship toRelationship : getRelationsToThisName()){
result.homotypicalGroup = HomotypicalGroup.NewInstance();
result.homotypicalGroup.addTypifiedName(this);
-
//HybridChildRelations
result.hybridChildRelations = new HashSet<>();
for (HybridRelationship hybridRelationship : getHybridChildRelations()){
return valid;\r
}\r
\r
- /**\r
- * @param specificEpithet\r
- * @return\r
- */\r
private boolean isNotBlank(String str) {\r
return StringUtils.isNotBlank(str);\r
}\r
* The contents of this file are subject to the Mozilla Public License Version 1.1\r
* See LICENSE.TXT at the top of this package for the full license terms.\r
*/\r
-\r
package eu.etaxonomy.cdm.strategy.cache.agent;\r
\r
-\r
import static org.junit.Assert.assertNotNull;\r
\r
import org.apache.commons.lang3.StringUtils;\r
import org.apache.log4j.Logger;\r
-import org.junit.After;\r
-import org.junit.AfterClass;\r
import org.junit.Assert;\r
import org.junit.Before;\r
-import org.junit.BeforeClass;\r
import org.junit.Test;\r
\r
import eu.etaxonomy.cdm.model.agent.Person;\r
* @since 29.09.2009\r
*/\r
public class PersonDefaultCacheStrategyTest {\r
- @SuppressWarnings("unused")\r
+\r
+ @SuppressWarnings("unused")\r
private static final Logger logger = Logger.getLogger(PersonDefaultCacheStrategyTest.class);\r
\r
private static Person person1;\r
private static Person person2;\r
private static Person person3;\r
\r
- /**\r
- * @throws java.lang.Exception\r
- */\r
- @BeforeClass\r
- public static void setUpBeforeClass() throws Exception {\r
- }\r
-\r
- /**\r
- * @throws java.lang.Exception\r
- */\r
- @AfterClass\r
- public static void tearDownAfterClass() throws Exception {\r
-\r
-\r
- }\r
-\r
- /**\r
- * @throws java.lang.Exception\r
- */\r
@Before\r
public void setUp() throws Exception {\r
person1 = Person.NewInstance();\r
person2.setSuffix("P2Suff");\r
\r
person3 = Person.NewInstance(); //empty person\r
-\r
- }\r
-\r
- /**\r
- * @throws java.lang.Exception\r
- */\r
- @After\r
- public void tearDown() throws Exception {\r
}\r
\r
//**************************************** TESTS **************************************\r
\r
- /**\r
- * Test method for {@link eu.etaxonomy.cdm.strategy.cache.agent.PersonDefaultCacheStrategy#NewInstance()}.\r
- */\r
@Test\r
public final void testNewInstance() {\r
PersonDefaultCacheStrategy cacheStrategy = PersonDefaultCacheStrategy.NewInstance();\r
Assert.assertEquals("Person3 title should start with Person#0", "Person#0", person3.getNomenclaturalTitle().substring(0, 8));\r
}\r
\r
-\r
@Test\r
public final void testGetTitleCacheAdaptedFromOldVersion(){\r
Assert.assertNotNull("person1 title cache must not to be null", person1.getTitleCache());\r
expected, pers.getTitleCache());\r
}\r
\r
-\r
@Test\r
public final void testGetFullTitle(){\r
Assert.assertNotNull("person1 full titlemust not to be null", person1.getFullTitle());\r
Assert.assertEquals("W.-H.-", formatter.getInitialsFromGivenName(givenname, force));\r
givenname = "W.-Hennin-";\r
Assert.assertEquals("W.-H.-", formatter.getInitialsFromGivenName(givenname, force));\r
-\r
}\r
-\r
}\r
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.strategy.cache.agent;
-
import static org.junit.Assert.assertNotNull;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.junit.After;
-import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
import eu.etaxonomy.cdm.model.agent.Person;
* @since 29.09.2009
*/
public class TeamDefaultCacheStrategyTest {
- @SuppressWarnings("unused")
+
+ @SuppressWarnings("unused")
private static final Logger logger = Logger.getLogger(TeamDefaultCacheStrategyTest.class);
private static Team team1;
private static Person person3;
private static Person person4;
- /**
- * @throws java.lang.Exception
- */
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- }
-
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
-
-
- }
-
- /**
- * @throws java.lang.Exception
- */
@Before
public void setUp() throws Exception {
team1 = Team.NewInstance();
team2.addTeamMember(person2);
team2.addTeamMember(person1);
team2.addTeamMember(person3);
-
-
-
}
- /**
- * @throws java.lang.Exception
- */
@After
public void tearDown() throws Exception {
}
//**************************************** TESTS **************************************
- /**
- * Test method for {@link eu.etaxonomy.cdm.strategy.cache.agent.PersonDefaultCacheStrategy#NewInstance()}.
- */
@Test
public final void testNewInstance() {
TeamDefaultCacheStrategy cacheStrategy = TeamDefaultCacheStrategy.NewInstance();
Assert.assertEquals("team2 nomenclatural title should still be 'P2LN, P., P1LN, P. & al.' now.",
"P2LN, P., P1LN, P. & al.", team2.getTitleCache());
-
//person3
Assert.assertNotNull("team3 title cache must not to be null",
team3.getTitleCache());
person1.setGivenName("O.");
Assert.assertEquals("team1 title cache should be P1LN, O.", "P1LN, O.", team1.getTitleCache());
}
-
}
</exclusion>
</exclusions>
</dependency>
- <!-- Since hibernate 5.0.4 the logging for a Dialect throws ClassDefNotFound for javax.transaction.SystemException if jta is missing -->
<dependency>
+ <!-- Since hibernate 5.0.4 the logging for a Dialect throws ClassDefNotFound for javax.transaction.SystemException if jta is missing -->
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</dependency>
<version>3.4.1.Final</version>
<!-- checked 2020-08 -->
</dependency>
- <!-- since hibernate 5.0.4 Dialect throws exception if jta is missing -->
<dependency>
+ <!-- since hibernate 5.0.4 Dialect throws exception if jta is missing -->
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
<artifactId>xml-apis</artifactId>
<!--
WARNING: do not upgrade to later versions 2.0.x of xml-apis
- since these are effectivly reloated to the early beta version
+ since these are effectivly reloaded to the early beta version
1.0.b2
-->
<version>1.4.01</version>