當前位置: 首頁>>代碼示例>>Java>>正文


Java Process類代碼示例

本文整理匯總了Java中com.google.refine.process.Process的典型用法代碼示例。如果您正苦於以下問題:Java Process類的具體用法?Java Process怎麽用?Java Process使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Process類屬於com.google.refine.process包,在下文中一共展示了Process類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: applyTransform

import com.google.refine.process.Process; //導入依賴的package包/類
private void applyTransform(Project project, JSONArray transform)
        throws JSONException {

    for (int i = 0; i < transform.length(); i++) {
        AbstractOperation operation = OperationRegistry.reconstruct(
                project, transform.getJSONObject(i));

        if (operation != null) {
            try {
                Process process = operation.createProcess(project,
                        new Properties());

                project.processManager.queueProcess(process);
            } catch (Exception ex) {
                fLogger.error("Error applying operation.", ex);
            }
        } else {
            fLogger.warn("Skipping unknown operation " + operation);
        }
    }
}
 
開發者ID:fusepoolP3,項目名稱:p3-batchrefine,代碼行數:22,代碼來源:TransformEngineImpl.java

示例2: doPost

import com.google.refine.process.Process; //導入依賴的package包/類
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    
    try {
        Project project = getProject(request);
        
        String keyColumnName = request.getParameter("keyColumnName");
        String valueColumnName = request.getParameter("valueColumnName");
        String noteColumnName = request.getParameter("noteColumnName");
        
        AbstractOperation op = new KeyValueColumnizeOperation(
            keyColumnName, valueColumnName, noteColumnName);
        
        Process process = op.createProcess(project, new Properties());
        
        performProcessAndRespond(request, response, project, process);
    } catch (Exception e) {
        respondException(response, e);
    }
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:22,代碼來源:KeyValueColumnizeCommand.java

示例3: doPost

import com.google.refine.process.Process; //導入依賴的package包/類
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    
    try {
        Project project = getProject(request);
        
        String columnName = request.getParameter("columnName");
        String keyColumnName = request.getParameter("keyColumnName");
        String separator = request.getParameter("separator");
        String mode = request.getParameter("mode");
        
        AbstractOperation op = new MultiValuedCellSplitOperation(columnName, keyColumnName, separator, mode);
        Process process = op.createProcess(project, new Properties());
        
        performProcessAndRespond(request, response, project, process);
    } catch (Exception e) {
        respondException(response, e);
    }
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:21,代碼來源:SplitMultiValueCellsCommand.java

示例4: doPost

import com.google.refine.process.Process; //導入依賴的package包/類
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    
    try {
        Project project = getProject(request);
        
        String columnName = request.getParameter("columnName");
        String keyColumnName = request.getParameter("keyColumnName");
        String separator = request.getParameter("separator");
        
        AbstractOperation op = new MultiValuedCellJoinOperation(columnName, keyColumnName, separator);
        Process process = op.createProcess(project, new Properties());
        
        performProcessAndRespond(request, response, project, process);
    } catch (Exception e) {
        respondException(response, e);
    }
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:20,代碼來源:JoinMultiValueCellsCommand.java

示例5: doPost

import com.google.refine.process.Process; //導入依賴的package包/類
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    
    try {
        Project project = getProject(request);
        
        String columnName = request.getParameter("columnName");
        int rowCount = Integer.parseInt(request.getParameter("rowCount"));
        
        AbstractOperation op = new TransposeRowsIntoColumnsOperation(
                columnName, rowCount);
        
        Process process = op.createProcess(project, new Properties());
        
        performProcessAndRespond(request, response, project, process);
    } catch (Exception e) {
        respondException(response, e);
    }
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:21,代碼來源:TransposeRowsIntoColumnsCommand.java

示例6: doPost

import com.google.refine.process.Process; //導入依賴的package包/類
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    
    try {
        Project project = getProject(request);
        
        String columnName = request.getParameter("columnName");
        
        AbstractOperation op = new ColumnRemovalOperation(columnName);
        Process process = op.createProcess(project, new Properties());
        
        performProcessAndRespond(request, response, project, process);
    } catch (Exception e) {
        respondException(response, e);
    }
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:18,代碼來源:RemoveColumnCommand.java

示例7: doPost

import com.google.refine.process.Process; //導入依賴的package包/類
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    
    try {
        Project project = getProject(request);
        
        String columnName = request.getParameter("columnName");
        int index = Integer.parseInt(request.getParameter("index"));
        
        AbstractOperation op = new ColumnMoveOperation(columnName, index);
        Process process = op.createProcess(project, new Properties());
        
        performProcessAndRespond(request, response, project, process);
    } catch (Exception e) {
        respondException(response, e);
    }
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:19,代碼來源:MoveColumnCommand.java

示例8: doPost

import com.google.refine.process.Process; //導入依賴的package包/類
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    
    try {
        Project project = getProject(request);
        
        String oldColumnName = request.getParameter("oldColumnName");
        String newColumnName = request.getParameter("newColumnName");
        
        AbstractOperation op = new ColumnRenameOperation(oldColumnName, newColumnName);
        Process process = op.createProcess(project, new Properties());
        
        performProcessAndRespond(request, response, project, process);
    } catch (Exception e) {
        respondException(response, e);
    }
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:19,代碼來源:RenameColumnCommand.java

示例9: performProcessAndRespond

import com.google.refine.process.Process; //導入依賴的package包/類
static protected void performProcessAndRespond(
    HttpServletRequest request,
    HttpServletResponse response,
    Project project,
    Process process
) throws Exception {
    response.setCharacterEncoding("UTF-8");
    response.setHeader("Content-Type", "application/json");

    HistoryEntry historyEntry = project.processManager.queueProcess(process);
    if (historyEntry != null) {
        Writer w = response.getWriter();
        JSONWriter writer = new JSONWriter(w);
        Properties options = new Properties();

        writer.object();
        writer.key("code"); writer.value("ok");
        writer.key("historyEntry"); historyEntry.write(writer, options);
        writer.endObject();

        w.flush();
        w.close();
    } else {
        respond(response, "{ \"code\" : \"pending\" }");
    }
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:27,代碼來源:Command.java

示例10: doPost

import com.google.refine.process.Process; //導入依賴的package包/類
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    
    try {
        Project project = getProject(request);
        AbstractOperation op;
        
        String startColumnName = request.getParameter("startColumnName");
        int columnCount = Integer.parseInt(request.getParameter("columnCount"));
        boolean ignoreBlankCells = Boolean.parseBoolean(request.getParameter("ignoreBlankCells"));
        boolean fillDown = Boolean.parseBoolean(request.getParameter("fillDown"));
        
        String combinedColumnName = request.getParameter("combinedColumnName");
        if (combinedColumnName != null) {
            boolean prependColumnName = Boolean.parseBoolean(request.getParameter("prependColumnName"));
            String separator = request.getParameter("separator");
            op = new TransposeColumnsIntoRowsOperation(
                startColumnName, columnCount,
                ignoreBlankCells, fillDown,
                combinedColumnName, prependColumnName, separator);
        } else {
            String keyColumnName = request.getParameter("keyColumnName");
            String valueColumnName = request.getParameter("valueColumnName");
            
            op = new TransposeColumnsIntoRowsOperation(
                startColumnName, columnCount,
                ignoreBlankCells, fillDown,
                keyColumnName, valueColumnName);
        }
        
        Process process = op.createProcess(project, new Properties());
        
        performProcessAndRespond(request, response, project, process);
    } catch (Exception e) {
        respondException(response, e);
    }
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:39,代碼來源:TransposeColumnsIntoRowsCommand.java

示例11: doPost

import com.google.refine.process.Process; //導入依賴的package包/類
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    
    try {
        Project project = getProject(request);
        
        AbstractOperation op = new DenormalizeOperation();
        Process process = op.createProcess(project, new Properties());
        
        performProcessAndRespond(request, response, project, process);
    } catch (Exception e) {
        respondException(response, e);
    }
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:16,代碼來源:DenormalizeCommand.java

示例12: doPost

import com.google.refine.process.Process; //導入依賴的package包/類
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    
    try {
        Project project = getProject(request);
        
        AbstractOperation op = createOperation(project, request, getEngineConfig(request));
        Process process = op.createProcess(project, new Properties());
        
        performProcessAndRespond(request, response, project, process);
    } catch (Exception e) {
        respondException(response, e);
    }
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:16,代碼來源:EngineDependentCommand.java

示例13: reconstructOperation

import com.google.refine.process.Process; //導入依賴的package包/類
protected void reconstructOperation(Project project, JSONObject obj) {
    AbstractOperation operation = OperationRegistry.reconstruct(project, obj);
    if (operation != null) {
        try {
            Process process = operation.createProcess(project, new Properties());
            
            project.processManager.queueProcess(process);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:13,代碼來源:ApplyOperationsCommand.java

示例14: createProcess

import com.google.refine.process.Process; //導入依賴的package包/類
@Override
public Process createProcess(Project project, Properties options) throws Exception {
    Engine engine = createEngine(project);
    engine.initializeFromJSON(_engineConfig);
    
    Evaluable eval = MetaParser.parse(_urlExpression);
    
    return new ColumnAdditionByFetchingURLsProcess(
        project, 
        engine,
        eval,
        getBriefDescription(null)
    );
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:15,代碼來源:ColumnAdditionByFetchingURLsOperation.java

示例15: createProcess

import com.google.refine.process.Process; //導入依賴的package包/類
@Override
public Process createProcess(Project project, Properties options) throws Exception {
    return new ReconProcess(
        project, 
        getEngineConfig(),
        getBriefDescription(null)
    );
}
 
開發者ID:dfci-cccb,項目名稱:mev,代碼行數:9,代碼來源:ReconOperation.java


注:本文中的com.google.refine.process.Process類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。