001/*-----------------------------------------------------------------------+ 002 | com.teamscale.checks 003 | | 004 $Id$ 005 | | 006 | Copyright (c) 2009-2015 CQSE GmbH | 007 +-----------------------------------------------------------------------*/ 008package eu.cqse.check.base; 009 010import eu.cqse.check.framework.core.CheckException; 011import eu.cqse.check.framework.shallowparser.framework.ShallowEntity; 012 013/** 014 * Base class for checks that select a set of entities via xPath and create a 015 * finding on the first line for each selected entity. 016 */ 017public abstract class EntityFirstLineFindingCheckBase extends EntityCheckBase { 018 019 /** {@inheritDoc} */ 020 @Override 021 protected void processEntity(ShallowEntity entity) throws CheckException { 022 createFindingOnFirstLine(getFindingMessage(entity), entity); 023 } 024 025 /** Creates a finding message for the given entity. */ 026 protected abstract String getFindingMessage(ShallowEntity entity); 027}