热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

com.android.tools.lint.detector.api.LintUtils.isXmlFile()方法的使用及代码示例

本文整理了Java中com.android.tools.lint.detector.api.LintUtils.isXmlFile()方法的一些代码示例,展示了

本文整理了Java中com.android.tools.lint.detector.api.LintUtils.isXmlFile()方法的一些代码示例,展示了LintUtils.isXmlFile()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LintUtils.isXmlFile()方法的具体详情如下:
包路径:com.android.tools.lint.detector.api.LintUtils
类名称:LintUtils
方法名:isXmlFile

LintUtils.isXmlFile介绍

[英]Returns true if the given file represents an XML file
[中]如果给定文件表示XML文件,则返回true

代码示例

代码示例来源:origin: com.android.tools.lint/lint_api

@Override
public boolean appliesTo(Context context, File file) {
return LintUtils.isXmlFile(file);
}

代码示例来源:origin: MasonLiuChn/AndroidLintPlus

@Override
public boolean appliesTo(@NonNull Context context,
@NonNull File file) {
return LintUtils.isXmlFile(file);
}

代码示例来源:origin: MasonLiuChn/AndroidLintPlus

@Override
public boolean appliesTo(@NonNull Context context,
@NonNull File file) {
return LintUtils.isXmlFile(file);
}

代码示例来源:origin: com.amazon.device.tools.lint/lint-checks

@Override
public boolean appliesTo(@NonNull Context context, @NonNull File file) {
return LintUtils.isXmlFile(file) || LintUtils.endsWith(file.getName(), DOT_JAVA);
}

代码示例来源:origin: com.amazon.device.tools.lint/lint-checks

@Override
public boolean appliesTo(@NonNull Context context, @NonNull File file) {
return LintUtils.isXmlFile(file) || LintUtils.endsWith(file.getName(), DOT_JAVA);
}

代码示例来源:origin: com.android.tools.lint/lint_api

continue;
} else if (file.isFile() && LintUtils.isXmlFile(file)) {

代码示例来源:origin: com.android.tools.lint/lint_api

void visitFile(Context context, File file) {
assert LintUtils.isXmlFile(file);

代码示例来源:origin: com.android.tools.lint/lint_api

private void checkResourceFolder(Project project, File dir, ResourceFolderType type,
List checks) {
// Process the resource folder
File[] xmlFiles = dir.listFiles();
if (xmlFiles != null && xmlFiles.length > 0) {
XmlVisitor visitor = getVisitor(type, checks);
if (visitor != null) { // if not, there are no applicable rules in this folder
for (File file : xmlFiles) {
if (LintUtils.isXmlFile(file)) {
Context cOntext= new Context(mClient, project, file, mScope);
fireEvent(EventType.SCANNING_FILE, context);
visitor.visitFile(context, file);
if (mCanceled) {
return;
}
}
}
}
}
}

代码示例来源:origin: com.amazon.device.tools.lint/lint-checks

File file = context.file;
boolean isXmlFile = LintUtils.isXmlFile(file);
if (isXmlFile || LintUtils.isBitmapFile(file)) {
String fileName = file.getName();

代码示例来源:origin: com.amazon.device.tools.lint/lint-checks

@Override
public void beforeCheckFile(@NonNull Context context) {
File file = context.file;
boolean isXmlFile = LintUtils.isXmlFile(file);
if (!isXmlFile && !LintUtils.isBitmapFile(file)) {
return;
}
String parentName = file.getParentFile().getName();
int dash = parentName.indexOf('-');
if (dash != -1 || FD_RES_VALUES.equals(parentName)) {
return;
}
ResourceFolderType folderType = ResourceFolderType.getFolderType(parentName);
if (folderType == null) {
return;
}
List types = FolderTypeRelationship.getRelatedResourceTypes(folderType);
if (types.isEmpty()) {
return;
}
ResourceType type = types.get(0);
String resourceName = getResourceFieldName(getBaseName(file.getName()));
if (isPrivate(context, type, resourceName)) {
String message = createOverrideErrorMessage(context, type, resourceName);
Location location = Location.create(file);
context.report(ISSUE, location, message);
}
}

代码示例来源:origin: com.android.tools.lint/lint-checks

@Override
public void beforeCheckFile(@NonNull Context context) {
File file = context.file;
boolean isXmlFile = LintUtils.isXmlFile(file);
if (!isXmlFile && !LintUtils.isBitmapFile(file)) {
return;
}
String parentName = file.getParentFile().getName();
int dash = parentName.indexOf('-');
if (dash != -1 || FD_RES_VALUES.equals(parentName)) {
return;
}
ResourceFolderType folderType = ResourceFolderType.getFolderType(parentName);
if (folderType == null) {
return;
}
List types = FolderTypeRelationship.getRelatedResourceTypes(folderType);
if (types.isEmpty()) {
return;
}
ResourceType type = types.get(0);
String resourceName = getResourceFieldName(getBaseName(file.getName()));
if (isPrivate(context, type, resourceName)) {
String message = createOverrideErrorMessage(context, type, resourceName);
Location location = Location.create(file);
context.report(ISSUE, location, message);
}
}

代码示例来源:origin: com.android.tools.lint/lint-api

void visitFile(@NonNull XmlContext context, @NonNull File file) {
assert LintUtils.isXmlFile(file);

代码示例来源:origin: com.android.tools.lint/lint-api

"\"res\" folder or resource folder", file.getPath());
} else if (file.isFile() && LintUtils.isXmlFile(file)) {

代码示例来源:origin: com.android.tools.lint/lint-api

if (LintUtils.isXmlFile(file)) {
XmlContext cOntext= new XmlContext(this, project, main, file, type,
visitor.getParser());

推荐阅读
author-avatar
生活碎事_780
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有