-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement better support for
ResourceDirective
- Loading branch information
Showing
5 changed files
with
147 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
.../src/main/java/au/com/integradev/delphi/preprocessor/directive/ResourceDirectiveImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Sonar Delphi Plugin | ||
* Copyright (C) 2024 Integrated Application Development | ||
* | ||
* This program 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. | ||
* | ||
* This program 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 this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | ||
*/ | ||
package au.com.integradev.delphi.preprocessor.directive; | ||
|
||
import java.util.List; | ||
import javax.annotation.Nullable; | ||
import org.sonar.plugins.communitydelphi.api.directive.ResourceDirective; | ||
import org.sonar.plugins.communitydelphi.api.token.DelphiToken; | ||
|
||
class ResourceDirectiveImpl extends ParameterDirectiveImpl implements ResourceDirective { | ||
private final String resourceFile; | ||
private final String resourceScriptFile; | ||
private final List<String> predicates; | ||
|
||
ResourceDirectiveImpl( | ||
DelphiToken token, | ||
String resourceFile, | ||
@Nullable String resourceScriptFile, | ||
List<String> predicates) { | ||
super(token, ParameterKind.RESOURCE); | ||
this.resourceFile = resourceFile; | ||
this.resourceScriptFile = resourceScriptFile; | ||
this.predicates = predicates; | ||
} | ||
|
||
@Override | ||
public String getResourceFile() { | ||
return resourceFile; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public String getResourceScriptFile() { | ||
return resourceScriptFile; | ||
} | ||
|
||
@Override | ||
public List<String> getPredicates() { | ||
return predicates; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...tend/src/main/java/org/sonar/plugins/communitydelphi/api/directive/ResourceDirective.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Sonar Delphi Plugin | ||
* Copyright (C) 2024 Integrated Application Development | ||
* | ||
* This program 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. | ||
* | ||
* This program 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 this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | ||
*/ | ||
package org.sonar.plugins.communitydelphi.api.directive; | ||
|
||
import java.util.List; | ||
import javax.annotation.Nullable; | ||
|
||
public interface ResourceDirective extends CompilerDirective { | ||
String getResourceFile(); | ||
|
||
@Nullable | ||
String getResourceScriptFile(); | ||
|
||
List<String> getPredicates(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters