org.sonar.api.resources.Resource Maven / Gradle / Ivy
/*
* Sonar, open source software quality management tool.
* Copyright (C) 2009 SonarSource SA
* mailto:contact AT sonarsource DOT com
*
* Sonar is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* Sonar is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Sonar; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
*/
package org.sonar.api.resources;
/**
* @since 1.10
*/
public interface Resource> {
String SCOPE_SET = "PRJ";
String SCOPE_SPACE = "DIR";
String SCOPE_ENTITY = "FIL";
/**
* Use SCOPE_SET instead
*/
@Deprecated
String SCOPE_PROJECT = SCOPE_SET;
/**
* Use SCOPE_SPACE instead
*/
@Deprecated
String SCOPE_DIRECTORY = SCOPE_SPACE;
/**
* Use SCOPE_ENTITY instead
*/
@Deprecated
String SCOPE_FILE = SCOPE_ENTITY;
String QUALIFIER_VIEW = "VW";
String QUALIFIER_SUBVIEW = "SVW";
String QUALIFIER_PROJECT = "TRK";
String QUALIFIER_MODULE = "BRC";
String QUALIFIER_PACKAGE = "PAC";
String QUALIFIER_DIRECTORY = "DIR";
String QUALIFIER_FILE = "FIL";
String QUALIFIER_CLASS = "CLA";
String QUALIFIER_UNIT_TEST_CLASS = "UTS";
/**
* Use QUALIFIER_PROJECT instead
*/
@Deprecated
String QUALIFIER_PROJECT_TRUNK = QUALIFIER_PROJECT;
/**
* Use QUALIFIER_MODULE instead
*/
@Deprecated
String QUALIFIER_PROJECT_BRANCH = QUALIFIER_MODULE;
String getKey();
String getName();
String getDescription();
Language getLanguage();
String getScope();
String getQualifier();
/**
* The parent is used to build the resources tree, for example for relations between classes, packages and projects.
* Return null if the parent is the project.
*/
PARENT getParent();
/**
* Check resource against an Ant pattern, like mypackag?/*Foo.java. It's used for example
* to match resource exclusions.
*
* @param antPattern Ant-like pattern (with **, * and ?). It includes file suffixes.
* @return true if the resource matches the Ant pattern
*/
boolean matchFilePattern(String antPattern);
}