Project

General

Profile

Revision acffd6b0

IDacffd6b0bb08a92be8823c115f24a311754f60db
Parent 4a428ec2
Child 24ebd429

Added by Andreas Müller 10 months ago

cleanup

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/HTMLTagRules.java
13 13
 *
14 14
 * @author a.mueller
15 15
 * @since 14/02/2012
16
 *
17 16
 */
18 17
public class HTMLTagRules {
19 18

  
......
41 40
	}
42 41

  
43 42
	public SortedSet<String> getRule(TagEnum type){
44
		SortedSet<String> result = new TreeSet<String>();
43
		SortedSet<String> result = new TreeSet<>();
45 44
		for (TagRule rule : rules){
46 45
			if (rule.type.equals(type)){
47 46
				result.add(rule.htmlTag);
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/TaggedCacheHelper.java
45 45

  
46 46
    /**
47 47
     * Creates a string from tagged text by concatenating all tags. If no separator tag is defined
48
     * tags are seperated by simple whitespace.
48
     * tags are separated by simple whitespace.
49 49
     * @param tags
50 50
     * @return
51 51
     */
......
131 131
    }
132 132

  
133 133
    private static SortedSet<String> getCommonRules(SortedSet<String> rules1,SortedSet<String> rules2) {
134
        SortedSet<String> result = new TreeSet<String>();
134
        SortedSet<String> result = new TreeSet<>();
135 135
        for (String str : rules1){
136 136
            if (rules2.contains(str)){
137 137
                result.add(str);
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/name/NameCacheStrategyBase.java
304 304
        return result;
305 305
    }
306 306

  
307
    /**
308
     * @param tags
309
     * @return
310
     */
311 307
    protected String createString(List<TaggedText> tags) {
312 308
        return TaggedCacheHelper.createString(tags);
313 309
    }
314 310

  
315
    /**
316
     * @param tags
317
     * @param htmlTagRules
318
     * @return
319
     */
320 311
    protected String createString(List<TaggedText> tags, HTMLTagRules htmlTagRules) {
321 312
        return TaggedCacheHelper.createString(tags, htmlTagRules);
322 313
    }
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/CdmGenericDaoImpl.java
565 565

  
566 566
		getSession().flush();
567 567
		try {
568
			List<T> result = new ArrayList<T>();
568
			List<T> result = new ArrayList<>();
569 569
			if(objectToMatch == null){
570 570
				return result;
571 571
			}
......
581 581
		}
582 582
	}
583 583

  
584
	private <T extends IMatchable> List<T> findMatchingNullSafe(T objectToMatch,	IMatchStrategyEqual matchStrategy) throws IllegalArgumentException, IllegalAccessException, MatchException {
585
		List<T> result = new ArrayList<T>();
584
	private <T extends IMatchable> List<T> findMatchingNullSafe(T objectToMatch,
585
	        IMatchStrategyEqual matchStrategy) throws IllegalArgumentException, IllegalAccessException, MatchException {
586

  
587
	    List<T> result = new ArrayList<>();
586 588
		Session session = getSession();
587 589
		Class<?> matchClass = objectToMatch.getClass();
588 590
		ClassMetadata classMetaData = session.getSessionFactory().getClassMetadata(matchClass.getCanonicalName());
......
605 607
		return result;
606 608
	}
607 609

  
608
	/**
609
	 * @param <T>
610
	 * @param objectToMatch
611
	 * @param matchStrategy
612
	 * @param classMetaData
613
	 * @param criteria
614
	 * @return
615
	 * @throws IllegalAccessException
616
	 * @throws MatchException
617
	 */
618 610
	private <T> boolean makeCriteria(T objectToMatch,
619 611
			IMatchStrategyEqual matchStrategy, ClassMetadata classMetaData,
620 612
			Criteria criteria) throws IllegalAccessException, MatchException {
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/CommonServiceImpl.java
50 50
    @SuppressWarnings("unused")
51 51
    private static final Logger logger = Logger.getLogger(CommonServiceImpl.class);
52 52

  
53

  
54 53
    @Autowired
55 54
    private IOriginalSourceDao originalSourceDao;
56 55

  
57

  
58 56
    @Autowired
59 57
    private ICdmGenericDao genericDao;
60 58

  
61

  
62 59
    @Override
63 60
    public <T extends CdmBase> T findWithUpdate(Class<T> clazz, int id){
64 61
        return genericDao.find(clazz, id);
......
90 87
        return list;
91 88
    }
92 89

  
93

  
94 90
    @Override
95 91
    public <S extends ISourceable> S getSourcedObjectByIdInSource(Class<S> clazz, String idInSource, String idNamespace) {
96 92
        S result = null;
......
100 96
        }return result;
101 97
    }
102 98

  
103

  
104 99
    @Override
105 100
    public Set<CdmBase> getReferencingObjects(CdmBase referencedCdmBase){
106 101
        return this.genericDao.getReferencingObjects(referencedCdmBase);
......
296 291
        merge(mergeFirst, mergeSecond, mergeStrategy);
297 292
    }
298 293

  
299

  
300 294
    @Override
301 295
    public <T extends IMatchable> List<T> findMatching(T objectToMatch, IMatchStrategyEqual matchStrategy) throws MatchException {
302 296
        if (matchStrategy == null){
......
305 299
        return genericDao.findMatching(objectToMatch, matchStrategy);
306 300
    }
307 301

  
308

  
309

  
310
    /* (non-Javadoc)
311
     * @see eu.etaxonomy.cdm.api.service.ICommonService#findMatching(eu.etaxonomy.cdm.strategy.match.IMatchable, eu.etaxonomy.cdm.strategy.match.MatchStrategyConfigurator.MatchStrategy)
312
     */
313 302
    @Override
314 303
    public <T extends IMatchable> List<T> findMatching(T objectToMatch, MatchStrategy strategy) throws MatchException {
315 304
        return findMatching(objectToMatch, MatchStrategyConfigurator.getMatchStrategy(strategy));
316 305
    }
317 306

  
318
    //	/* (non-Javadoc)
319
    //	 * @see eu.etaxonomy.cdm.api.service.IService#list(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
320
    //	 */
321
    //	@Override
322
    //	public <TYPE extends OriginalSourceBase> Pager<TYPE> list(Class<TYPE> type,
323
    //			Integer pageSize, Integer pageNumber, List<OrderHint> orderHints,
324
    //			List<String> propertyPaths) {
325
    //		logger.warn("Not yet implemented");
326
    //		return null;
327
    //	}
328

  
329

  
330 307
    @Transactional(readOnly = false)
331 308
    @Override
332 309
    public void saveAllMetaData(Collection<CdmMetaData> metaData) {
......
398 375
        genericDao.createFullSampleData();
399 376
    }
400 377

  
401

  
402

  
403 378
    @Override
404 379
    public <S extends CdmBase> List<S> list(Class<S> type, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths){
405 380
        return genericDao.list(type, limit, start, orderHints, propertyPaths);
......
428 403
        return genericDao.saveOrUpdate(newInstance);
429 404
    }
430 405

  
431

  
432 406
    @Override
433 407
    @Transactional(readOnly = false)
434 408
    public <T extends CdmBase> Map<UUID,T> save(Collection<T> newInstances) {
......
455 429
    public List<UUID> listUuid(Class<? extends CdmBase> clazz) {
456 430
        return genericDao.listUuid(clazz);
457 431
    }
458

  
459 432
}
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonNodeServiceImpl.java
158 158
        return dao.listChildrenOf(node, pageSize, pageIndex, recursive, includeUnpublished, propertyPaths);
159 159
    }
160 160

  
161
    /**
162
     * {@inheritDoc}
163
     */
164 161
    @Override
165 162
    public TaxonNodeDto getParentUuidAndTitleCache(ITaxonTreeNode child) {
166 163
        UUID uuid = child.getUuid();
......
169 166
        return getParentUuidAndTitleCache(uuidAndTitleCache);
170 167
    }
171 168

  
172
    /**
173
     * {@inheritDoc}
174
     */
175 169
    @Override
176 170
    public TaxonNodeDto getParentUuidAndTitleCache(TaxonNodeDto child) {
177 171
        return dao.getParentUuidAndTitleCache(child);
......
182 176
        return dao.listChildNodesAsTaxonNodeDto(parent);
183 177
    }
184 178

  
185

  
186

  
187 179
    @Override
188 180
    public List<UuidAndTitleCache<TaxonNode>> getUuidAndTitleCache(Integer limit, String pattern, UUID classificationUuid) {
189 181
        return dao.getUuidAndTitleCache(limit, pattern, classificationUuid);
......
1081 1073
        return result;
1082 1074
    }
1083 1075

  
1084

  
1085

  
1086 1076
    @Override
1087 1077
    public long count(TaxonNodeFilter filter){
1088 1078
        return nodeFilterDao.count(filter);
......
1142 1132
        return commonParent;
1143 1133
    }
1144 1134

  
1145

  
1146

  
1147 1135
    @Override
1148 1136
    public List<TaxonDistributionDTO> getTaxonDistributionDTOForSubtree(UUID parentNodeUuid, List<String> propertyPaths, Authentication authentication){
1149 1137
        List<TaxonNode> nodes = listChildrenOf(load(parentNodeUuid), null, null,
......
1217 1205
    public List<UuidAndTitleCache<TaxonNode>> listChildNodesAsUuidAndTitleCache(UuidAndTitleCache<TaxonNode> parent) {
1218 1206
        return dao.listChildNodesAsUuidAndTitleCache(parent);
1219 1207
    }
1220

  
1221

  
1222 1208
}
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/config/DeleteConfiguratorBase.java
14 14

  
15 15
/**
16 16
 * Base class for delete configurators.
17
 *
17 18
 * @author a.mueller
18 19
 * @since 04.01.2012
19
 *
20 20
 */
21 21
public abstract class DeleteConfiguratorBase implements Serializable {
22
	@SuppressWarnings("unused")
22

  
23
    private static final long serialVersionUID = 8841790311273474123L;
24
    @SuppressWarnings("unused")
23 25
	private static final Logger logger = Logger.getLogger(DeleteConfiguratorBase.class);
24 26

  
25 27
	private boolean isCheck = false;
26 28

  
27
	/**
28
	 * @return the isCheck
29
	 */
30 29
	public boolean isCheck() {
31 30
		return isCheck;
32 31
	}
33

  
34
	/**
35
	 * @param isCheck the isCheck to set
36
	 */
37 32
	public void setCheck(boolean isInternal) {
38 33
		this.isCheck = isInternal;
39 34
	}
40

  
41

  
42 35
}
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/config/SynonymDeletionConfigurator.java
17 17
 *
18 18
 * @author k.luther
19 19
 * @since 09.11.2011
20
 *
21 20
 */
22 21
public class SynonymDeletionConfigurator extends TaxonBaseDeletionConfigurator{
23
	private boolean newHomotypicGroupIfNeeded = true;
22
    private static final long serialVersionUID = 6899789097652652387L;
23

  
24
    private boolean newHomotypicGroupIfNeeded = true;
24 25

  
25 26
	public boolean isNewHomotypicGroupIfNeeded() {
26 27
		return newHomotypicGroupIfNeeded;
......
29 30
	public void setNewHomotypicGroupIfNeeded(boolean newHomotypicGroupIfNeeded) {
30 31
		this.newHomotypicGroupIfNeeded = newHomotypicGroupIfNeeded;
31 32
	}
32

  
33

  
34

  
35

  
36 33
}
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/config/TaxonBaseDeletionConfigurator.java
21 21
 */
22 22
public class TaxonBaseDeletionConfigurator extends DeleteConfiguratorBase{
23 23

  
24
	private boolean deleteNameIfPossible = true;
24
    private static final long serialVersionUID = -370747732061036090L;
25

  
26
    private boolean deleteNameIfPossible = true;
25 27
	private boolean deleteSynonymRelations = true;
26 28

  
27 29
	private NameDeletionConfigurator nameDeletionConfig = new NameDeletionConfigurator();

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)