作者:生活碎事_780 | 来源:互联网 | 2023-08-07 10:16
本文整理了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());