当前位置: 首页>>代码示例>>Java>>正文


Java ErrorHandler类代码示例

本文整理汇总了Java中org.galagosearch.tupleflow.execution.ErrorHandler的典型用法代码示例。如果您正苦于以下问题:Java ErrorHandler类的具体用法?Java ErrorHandler怎么用?Java ErrorHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ErrorHandler类属于org.galagosearch.tupleflow.execution包,在下文中一共展示了ErrorHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: verify

import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
    if (!parameters.getXML().containsKey("filename")) {
        handler.addError("ManifestWriter requires a 'filename' parameter.");
        return;
    }

    File f = new File(parameters.getXML().get("filename"));

    if (f.isFile() && f.canWrite()) {
        return; // good news
    }
    if (f.isDirectory()) {
        handler.addError("Pathname " + f.toString() + " exists, and it is a directory, but " +
                "ManifestWriter would like to write a file there.");
        return;
    }

    // this will search upwards and verify that we can make
    // the necessary directory structure to store this file.
    Verification.requireWriteableFile(f.toString(), handler);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:22,代码来源:ManifestWriter.java

示例2: verify

import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) throws ClassNotFoundException {
    if (!Verification.requireParameters(new String[]{"class", "order"}, parameters.getXML(),
                                        handler)) {
        return;
    }
    String className = parameters.getXML().get("class");
    String[] order = parameters.getXML().get("order").split(" ");
    boolean result;

    result = Verification.requireClass(className, handler);
    result = result && Verification.requireOrder(className, order, handler);

    if (!result) {
        return;
    }
    Class klass = Class.forName(className);
    Verification.verifyTypeReader("keys", klass, order, parameters, handler);
    Verification.verifyTypeReader("values", klass, order, parameters, handler);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:20,代码来源:Select.java

示例3: verify

import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters fullParameters, ErrorHandler handler) {
    Parameters parameters = fullParameters.getXML();
    String[] requiredParameters = {"order", "class"};

    if (!Verification.requireParameters(requiredParameters, parameters, handler)) {
        return;
    }
    String className = parameters.get("class");
    String[] orderSpec = parameters.get("order").split(" ");

    Verification.requireClass(className, handler);
    Verification.requireOrder(className, orderSpec, handler);

    if (parameters.containsKey("reducer")) {
        String reducerType = parameters.get("reducer");
        Verification.requireClass(reducerType, handler);
    }
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:19,代码来源:Sorter.java

示例4: verify

import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
    if (!parameters.getXML().containsKey("filename")) {
        handler.addError("DocumentLengthsWriter requires an 'filename' parameter.");
        return;
    }

    String filename = parameters.getXML().get("filename");
    Verification.requireWriteableFile(filename, handler);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:10,代码来源:DocumentLengthsWriter.java

示例5: verify

import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
    if (!parameters.getXML().containsKey("filename")) {
        handler.addError("PositionsListWriter requires an 'filename' parameter.");
        return;
    }

    String index = parameters.getXML().get("filename");
    Verification.requireWriteableFile(index, handler);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:10,代码来源:PositionIndexWriter.java

示例6: verify

import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
    if (parameters.getXML().containsKey("filename")) {
        return;
    }
    if (parameters.getXML().stringList("word").size() == 0) {
        handler.addWarning("Couldn't find any words in the stopword list.");
    }
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:9,代码来源:WordFilter.java

示例7: verify

import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
    if (!Verification.requireParameters(new String[] { "textSource" }, parameters.getXML(), handler))
        return;

    String readerName = parameters.getXML().get("textSource");
    Verification.verifyTypeReader(readerName, AdditionalDocumentText.class, parameters, handler);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:8,代码来源:AdditionalTextCombiner.java

示例8: verify

import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
    if (!parameters.getXML().containsKey("filename")) {
        handler.addError("DocumentIndexWriter requires an 'filename' parameter.");
        return;
    }

    String index = parameters.getXML().get("filename");
    Verification.requireWriteableFile(index, handler);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:10,代码来源:DocumentIndexWriter.java

示例9: verify

import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
    if (!Verification.requireParameters(new String[]{"filename"}, parameters.getXML(), handler)) {
        return;
    }
    String filename = parameters.getXML().get("filename");
    if (!new File(filename).isFile()) {
        handler.addError("File " + filename + " does not exist.");
    }
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:10,代码来源:PriorParser.java

示例10: verify

import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
    if (!Verification.requireParameters(new String[] { "extractedLinks", "documentDatas" },
                                        parameters.getXML(), handler)) {
        return;
    }

    String extractedLinksName = parameters.getXML().get("extractedLinks");
    String documentDatasName = parameters.getXML().get("documentDatas");

    Verification.verifyTypeReader(extractedLinksName, ExtractedLink.class, parameters, handler);
    Verification.verifyTypeReader(documentDatasName, DocumentData.class, parameters, handler);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:13,代码来源:LinkCombiner.java

示例11: verify

import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) throws ClassNotFoundException {
    Verification.requireParameters(new String[]{"input", "class"}, parameters.getXML(), handler);

    List<String> inputs = parameters.getXML().stringList("input");
    String cls = parameters.getXML().get("class");

    for (String input : inputs) {
        Verification.verifyTypeReader(input, Class.forName(cls), parameters, handler);
    }
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:11,代码来源:StreamCombiner.java

示例12: verify

import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static boolean verify(TupleFlowParameters parameters, ErrorHandler handler) {
    Parameters p = parameters.getXML();
    if (!Verification.requireParameters(new String[] { "filename", "class" }, p, handler))
        return false;
    if (!Verification.requireClass(p.get("class"), handler))
        return false;
    if (!Verification.requireWriteableFile(p.get("filename"), handler))
        return false;
    return true;
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:11,代码来源:TextWriter.java

示例13: verify

import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
    if (!(parameters.getXML().containsKey("directory") || parameters.getXML().containsKey("filename"))) {
        handler.addError("FileSource requires either at least one directory or filename parameter.");
        return;
    }

    if (parameters.getXML().containsKey("directory")) {
        List<Value> directories = parameters.getXML().list("directory");

        for (Value directory : directories) {
            File directoryFile = new File(directory.toString());

            if (directoryFile.exists() == false) {
                handler.addError("Directory " + directoryFile.toString() + " doesn't exist.");
            } else if (directoryFile.isDirectory() == false) {
                handler.addError(directoryFile.toString() + " exists, but it isn't a directory.");
            }
        }
    } else if (parameters.getXML().containsKey("filename")) {
        List<Value> files = parameters.getXML().list("filename");

        for (Value file : files) {
            File f = new File(file.toString());

            if (f.exists() == false) {
                handler.addError("File " + file.toString() + " doesn't exist.");
            } else if (f.isFile() == false) {
                handler.addError(file.toString() + " exists, but isn't a file.");
            }
        }
    }
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:33,代码来源:FileSource.java

示例14: verify

import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
    if (!parameters.getXML().containsKey("filename")) {
        handler.addError("DocumentNameWriter requires an 'filename' parameter.");
        return;
    }
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:7,代码来源:DocumentNameWriter.java

示例15: verify

import org.galagosearch.tupleflow.execution.ErrorHandler; //导入依赖的package包/类
public static void verify(TupleFlowParameters parameters, ErrorHandler handler) {
    Verification.verifyTypeReader("numberedDocumentData", NumberedDocumentData.class,
            parameters, handler);
}
 
开发者ID:jjfiv,项目名称:galagosearch,代码行数:5,代码来源:PositionPostingsNumberer.java


注:本文中的org.galagosearch.tupleflow.execution.ErrorHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。