Java 类org.eclipse.core.runtime.content.IContentDescriber 实例源码

项目:mule-tooling-incubator    文件:StudioGradleEnabledContentDescriber.java   
@Override
public int describe(InputStream contents, IContentDescription description) throws IOException {

    try {
        GradleScriptASTParser parser = new GradleScriptASTParser(contents);
        PluginsSyntaxDescriberVisitor pluginsVisitor = new PluginsSyntaxDescriberVisitor();
        ApplySyntaxDescriberVisitor visitor = new ApplySyntaxDescriberVisitor();

        parser.walkScript(pluginsVisitor);

        if (pluginsVisitor.isFoundPlugin()) {
            return IContentDescriber.VALID;
        }

        parser.walkScript(visitor);

        if (visitor.isFoundplugin()) {
            return IContentDescriber.VALID;
        }

    } catch (MultipleCompilationErrorsException ex) {
        return IContentDescriber.INDETERMINATE;
    }
    return IContentDescriber.INVALID;
}
项目:eclipse-wtp-json    文件:ContentDescriberForJSON.java   
public int describe(InputStream contents, IContentDescription description)
        throws IOException {
    int result = IContentDescriber.INDETERMINATE;

    if (description == null) {
        result = computeValidity(contents);
    } else {
        calculateSupportedOptions(contents, description);
        result = computeValidity(contents);
    }
    return result;
}
项目:eclipse-wtp-json    文件:ContentDescriberForJSON.java   
public int describe(Reader contents, IContentDescription description)
        throws IOException {
    int result = IContentDescriber.INDETERMINATE;

    if (description == null) {
        result = computeValidity(contents);
    } else {
        calculateSupportedOptions(contents, description);
        result = computeValidity(contents);
    }
    return result;
}
项目:eclipse-wtp-json    文件:ContentDescriberForJSON.java   
private int computeValidity(InputStream inputStream) {
    // currently no specific check for validilty
    // based on contents.
    return IContentDescriber.INDETERMINATE;
}
项目:eclipse-wtp-json    文件:ContentDescriberForJSON.java   
private int computeValidity(Reader reader) {
    // currently no specific check for validilty
    // based on contents.
    return IContentDescriber.INDETERMINATE;
}
项目:mule-tooling-incubator    文件:StudioGradleEnabledContentDescriber.java   
@Override
public int describe(Reader contents, IContentDescription description) throws IOException {
    return IContentDescriber.INDETERMINATE;
}