本文整理了Java中com.android.tools.lint.detector.api.Location.getMessage()
方法的一些代码示例,展示了Location.getMessage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Location.getMessage()
方法的具体详情如下:
包路径:com.android.tools.lint.detector.api.Location
类名称:Location
方法名:getMessage
[英]Returns the custom message for this location, if any. This is typically used for secondary locations, to describe the significance of this alternate location. For example, for a duplicate id warning, the primary location might say "This is a duplicate id", pointing to the second occurrence of id declaration, and then the secondary location could point to the original declaration with the custom message "Originally defined here".
[中]返回此位置的自定义消息(如果有)。这通常用于辅助位置,以描述此备用位置的重要性。例如,对于重复id警告,主位置可能会说“这是一个重复id”,指向第二次出现的id声明,然后辅助位置可能会指向带有自定义消息“最初定义在此处”的原始声明。
代码示例来源:origin: com.android.tools.lint/lint
boolean omitted = false;
while (location != null) {
if (location.getMessage() != null
&& !location.getMessage().isEmpty()) {
output.append(" ");
String path = client.getDisplayPath(warning.project,
if (location.getMessage() != null
&& !location.getMessage().isEmpty()) {
output.append(':');
output.append(' ');
output.append(RAW.convertTo(location.getMessage(), TEXT));
int begin = sb.length();
while (location != null) {
if (location.getMessage() == null
|| location.getMessage().isEmpty()) {
if (sb.length() > begin) {
sb.append(", ");
代码示例来源:origin: com.android.tools.lint/lint
int otherLocations = 0;
while (l != null) {
String message = l.getMessage();
if (message != null && !message.isEmpty()) {
Position start = l.getStart();
代码示例来源:origin: com.android.tools.lint/lint-tests
if (l.getMessage() == null) {
l.setMessage("<No location-specific message");
代码示例来源:origin: com.android.tools.lint/lint
int shownSnippetsCount = 0;
while (l != null) {
String message = l.getMessage();
if (message != null && !message.isEmpty()) {
Position start = l.getStart();
代码示例来源:origin: com.android.tools.lint/lint-tests
if (l.getMessage() == null) {
l.setMessage("<No location-specific message");
内容来源于网络,如有侵权,请联系作者删除!