本文整理了Java中com.android.tools.lint.detector.api.Location.getSecondary()
方法的一些代码示例,展示了Location.getSecondary()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Location.getSecondary()
方法的具体详情如下:
包路径:com.android.tools.lint.detector.api.Location
类名称:Location
方法名:getSecondary
[英]Returns a secondary location associated with this location (if applicable), or null.
[中]返回与此位置关联的辅助位置(如果适用),或null。
代码示例来源:origin: com.android.tools.lint/lint-api
/**
* Reverses the secondary location list initiated by the given location
*
* @param location the first location in the list
* @return the first location in the reversed list
*/
public static Location reverse(@NonNull Location location) {
Location next = location.getSecondary();
location.setSecondary(null);
while (next != null) {
Location nextNext = next.getSecondary();
next.setSecondary(location);
location = next;
next = nextNext;
}
return location;
}
代码示例来源:origin: com.android.tools.lint/lint
private boolean addImage(String url, Location location) throws IOException {
if (url != null && endsWith(url, DOT_PNG)) {
if (location.getSecondary() != null) {
urls.add(imageUrl);
location = location.getSecondary();
代码示例来源:origin: com.android.tools.lint/lint-api
currentLocation = currentLocation.getSecondary();
代码示例来源:origin: com.android.tools.lint/lint-checks
boolean foundConflict = false;
Location curr;
for (curr = location; curr != null; curr = curr.getSecondary()) {
Object clientData = curr.getClientData();
if (clientData instanceof Node) {
代码示例来源:origin: com.amazon.device.tools.lint/lint-checks
} else {
Location curr = location.getSecondary();
while (curr != null) {
Location next = curr.getSecondary();
if (next == location) {
curr.setSecondary(null);
代码示例来源:origin: com.android.tools.lint/lint-checks
} else {
Location curr = location.getSecondary();
while (curr != null) {
Location next = curr.getSecondary();
if (next == location) {
curr.setSecondary(null);
代码示例来源:origin: com.amazon.device.tools.lint/lint-checks
boolean foundConflict = false;
Location curr;
for (curr = location; curr != null; curr = curr.getSecondary()) {
Object clientData = curr.getClientData();
if (clientData instanceof Node) {
代码示例来源:origin: com.android.tools.lint/lint
if (warning.location != null && warning.location.getSecondary() != null) {
Location location = warning.location.getSecondary();
boolean omitted = false;
while (location != null) {
location = location.getSecondary();
location = warning.location.getSecondary();
StringBuilder sb = new StringBuilder(100);
sb.append("Also affects: ");
location = location.getSecondary();
代码示例来源:origin: com.android.tools.lint/lint
&& warning.location.getSecondary() == null) {
addedImage = addImage(url, warning.location);
if (warning.location != null && warning.location.getSecondary() != null) {
writer.write("<ul>");
Location l = warning.location.getSecondary();
int otherLocations = 0;
while (l != null) {
l = l.getSecondary();
l = warning.location.getSecondary();
while (l != null) {
Position start = l.getStart();
writeLocation(l.getFile(), path, line);
writer.write("\n");
l = l.getSecondary();
&& warning.location.getSecondary() != null) {
addImage(url, warning.location);
代码示例来源:origin: com.android.tools.lint/lint-tests
if (location.getSecondary() != null) {
Location l = location.getSecondary();
if (l == location) {
fail("Location link cycle");
l.setMessage("<No location-specific message");
if (l == l.getSecondary()) {
fail("Location link cycle");
l = l.getSecondary();
代码示例来源:origin: com.android.tools.lint/lint
Location secondary1 = location != null ? location.getSecondary() : null;
Location secondary2 = warning.location != null ? warning.location.getSecondary() : null;
if (secondary1 != null) {
if (secondary2 != null) {
代码示例来源:origin: com.android.tools.lint/lint-checks
private void reportIfFound(@NonNull XmlContext context, @NonNull String qualifiers,
@NonNull String name, @NonNull ResourceType type, @Nullable Node secondary) {
Multimap<ResourceType, Location> typeMap = mManifestLocations.get(name);
if (typeMap != null) {
Collection<Location> locations = typeMap.get(type);
if (locations != null) {
for (Location location : locations) {
String message = getErrorMessage(qualifiers);
if (secondary != null) {
Location secondaryLocation = context.getLocation(secondary);
secondaryLocation.setSecondary(location.getSecondary());
secondaryLocation.setMessage("This value will not be used");
location.setSecondary(secondaryLocation);
}
context.report(ISSUE, location, message);
}
}
}
}
代码示例来源:origin: com.android.tools.lint/lint-tests
if (location.getSecondary() != null) {
Location l = location.getSecondary();
if (l == location) {
fail("Location link cycle");
l.setMessage("<No location-specific message");
if (l == l.getSecondary()) {
fail("Location link cycle");
l = l.getSecondary();
代码示例来源:origin: com.android.tools.lint/lint
location = location.getSecondary();
代码示例来源:origin: com.android.tools.lint/lint
private boolean addImage(String url, Location location) {
if (url != null && endsWith(url, DOT_PNG)) {
if (location.getSecondary() != null) {
urls.add(imageUrl);
location = location.getSecondary();
代码示例来源:origin: com.android.tools.lint/lint
Location secondary1 = location != null ? location.getSecondary() : null;
File secondaryFile1 = secondary1 != null ? secondary1.getFile() : null;
Location secondary2 = other.location != null ? other.location.getSecondary() : null;
File secondaryFile2 = secondary2 != null ? secondary2.getFile() : null;
if (secondaryFile1 != null) {
代码示例来源:origin: com.android.tools.lint/lint-api
Location secondary1 = location.getSecondary();
File secondaryFile1 = secondary1 != null ? secondary1.getFile() : null;
Location secondary2 = other.location.getSecondary();
File secondaryFile2 = secondary2 != null ? secondary2.getFile() : null;
if (secondaryFile1 != null) {
代码示例来源:origin: com.android.tools.lint/lint
&& warning.location.getSecondary() == null) {
addedImage = addImage(url, warning.location);
if (warning.location != null && warning.location.getSecondary() != null) {
append("<ul>");
Location l = warning.location.getSecondary();
int otherLocations = 0;
int shownSnippetsCount = 0;
l = l.getSecondary();
l = warning.location.getSecondary();
while (l != null) {
Position start = l.getStart();
writeLocation(l.getFile(), path, line);
append("\n");
l = l.getSecondary();
&& warning.location.getSecondary() != null) {
addImage(url, warning.location);
内容来源于网络,如有侵权,请联系作者删除!