* A class for handling DOIs (http://www.doi.org).\r
* It offers parsing and formatting functionality as well as validation.\r
* A {@link DOI} object can only be created by syntactic valid input.\r
- * It internally stores a doi 2 strings, the first one being the registrant number\r
+ * It internally stores 2 strings, the first one being the registrant number\r
* (including sub numbers), the second being the suffix.\r
*\r
*\r
items.add(nextUnprocessed);
} else {
if(remainingUnprocessed == null) {
- remainingUnprocessed = new ArrayList<Integer>(unprocessedIds.size() - i + 1);
+ remainingUnprocessed = new ArrayList<>(unprocessedIds.size() - i + 1);
}
remainingUnprocessed.add(nextUnprocessed);
}
batchItemCount++;
}
- /**
- *
- */
private void reduceSize() {
manageUnprocessedItems();
batchSize = itemWhereLimitsTouched;
}
}
- /**
- *
- */
protected void manageUnprocessedItems() {
if(itemWhereLimitsTouched > 0) {
package eu.etaxonomy.cdm.common;\r
\r
import org.junit.Assert;\r
-import org.junit.Before;\r
import org.junit.Test;\r
\r
/**\r
- *\r
* Test class for testing the {@link DOI} class.\r
*\r
* For doi syntax see also http://www.doi.org/doi_handbook/2_Numbering.html\r
* http://stackoverflow.com/questions/27910/finding-a-doi-in-a-document-or-page\r
*\r
* @author a.mueller\r
- *\r
*/\r
public class DoiTest {\r
\r
- /**\r
- * @throws java.lang.Exception\r
- */\r
- @Before\r
- public void setUp() throws Exception {\r
- }\r
-\r
@Test\r
public void testValidParser() {\r
String validDoi = "10.1002/1234";\r
}\r
\r
\r
-\r
-\r
private void testInvalid(String invalidDoi) {\r
try {\r
DOI.fromString(invalidDoi);\r
/**\r
* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
* http://www.e-taxonomy.eu\r
-* \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
if (o == null) {\r
return null;\r
}\r
- \r
+\r
DOI doi = (DOI) o;\r
\r
try {\r
}\r
\r
@Override\r
- public DOI nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) \r
+ public DOI nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner)\r
throws HibernateException, SQLException {\r
String val = (String) StandardBasicTypes.STRING.nullSafeGet(rs, names, session, owner);\r
- \r
+\r
if(val == null) {\r
return null;\r
} else {\r
}\r
\r
@Override\r
- public void nullSafeSet(PreparedStatement statement, Object value, int index, SessionImplementor session) \r
+ public void nullSafeSet(PreparedStatement statement, Object value, int index, SessionImplementor session)\r
throws HibernateException, SQLException {\r
- if (value == null) { \r
+ if (value == null) {\r
StandardBasicTypes.STRING.nullSafeSet(statement, value, index, session);\r
- } else { \r
+ } else {\r
DOI doi = (DOI)value;\r
StandardBasicTypes.STRING.nullSafeSet(statement, doi.toString(), index, session);\r
}\r
public int[] sqlTypes() {\r
return SQL_TYPES;\r
}\r
-\r
- \r
-\r
-\r
-\r
}\r