當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。