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


Java NeedPostProcess類代碼示例

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


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

示例1: doProcess

import net.java.amateras.xlsbeans.NeedPostProcess; //導入依賴的package包/類
public void doProcess(WSheet wSheet, Object obj, Field field, Annotation ann,
		AnnotationReader reader, List<NeedPostProcess> needPostProcess)
		throws Exception {

       IterateTables iterateTables = (IterateTables) ann;

       Class<?> fieldType = field.getType();

       // create multi-table objects.
       List<?> value = createTables(wSheet, iterateTables, reader, needPostProcess);
       if (List.class.isAssignableFrom(fieldType)) {
           field.set(obj, value);

       } else if (fieldType.isArray()) {
       	Class<?> type = fieldType.getComponentType();
       	Object array = Array.newInstance(type, value.size());
       	for(int i=0;i<value.size();i++){
       		Array.set(array, i, value.get(i));
       	}
       	field.set(obj, array);

       } else {
           throw new XLSBeansException(
           		"Arguments of '" + field.toString() + "' is invalid.");
       }
}
 
開發者ID:otsecbsol,項目名稱:linkbinder,代碼行數:27,代碼來源:IterateTablesProcessor.java

示例2: doProcess

import net.java.amateras.xlsbeans.NeedPostProcess; //導入依賴的package包/類
public void doProcess(WSheet wSheet, Object obj, Field field, Annotation ann, AnnotationReader reader,
                         XLSBeansConfig config, List<NeedPostProcess> needPostProcess) throws Exception {

       IterateTables iterateTables = (IterateTables) ann;

       Class<?> fieldType = field.getType();

       // create multi-table objects.
       List<?> value = createTables(wSheet, iterateTables, reader, config, needPostProcess);
       if (List.class.isAssignableFrom(fieldType)) {
           field.set(obj, value);

       } else if (fieldType.isArray()) {
       	Class<?> type = fieldType.getComponentType();
       	Object array = Array.newInstance(type, value.size());
       	for(int i = 0; i < value.size(); i++){
       		Array.set(array, i, value.get(i));
       	}
       	field.set(obj, array);

       } else {
           throw new XLSBeansException("Arguments of '" + field.toString() + "' is invalid.");
       }
}
 
開發者ID:takezoe,項目名稱:xlsbeans,代碼行數:25,代碼來源:IterateTablesProcessor.java

示例3: createTables

import net.java.amateras.xlsbeans.NeedPostProcess; //導入依賴的package包/類
protected List<?> createTables(WSheet wSheet, IterateTables iterateTables, AnnotationReader reader,
                               XLSBeansConfig config, List<NeedPostProcess> needPostProcess) throws Exception {
    List<Object> resultTableList = new ArrayList<Object>();

    WCell after = null;
    WCell currentCell = null;
    String label = iterateTables.tableLabel();
    currentCell = Utils.getCell(wSheet, label, after, false, !iterateTables.optional(), config);
    while (currentCell != null) {
        // 1 table object instance
        Object tableObj = iterateTables.tableClass().newInstance();

        // process single label.
        processSingleLabelledCell(wSheet, tableObj, currentCell, reader, config, needPostProcess);
        // process horizontal table.
        processMultipleTableCell(wSheet, tableObj, currentCell, reader, iterateTables, config, needPostProcess);

        // TODO process vertical table

        resultTableList.add(tableObj);
        after = currentCell;
        currentCell = Utils.getCell(wSheet, label, after, false, false, config);
    }
    return resultTableList;
}
 
開發者ID:takezoe,項目名稱:xlsbeans,代碼行數:26,代碼來源:IterateTablesProcessor.java

示例4: createTables

import net.java.amateras.xlsbeans.NeedPostProcess; //導入依賴的package包/類
/**
 * VerticalRecordsへの対応のため、オーバーライドしました。
 * @param sheet シート
 * @param tables IterateTablesアノテーションの定義
 * @param reader アノテーションリーダ
 * @param process プロセッサ
 * @throws Exception 予期しない例外
 */
@Override
protected List<?> createTables(WSheet sheet, IterateTables tables, AnnotationReader reader, List<NeedPostProcess> process)
    throws Exception {

    List<Object> resultTableList = new ArrayList<Object>();
    String label = tables.tableLabel();
    WCell after = null;
    WCell currentCell = Utils.getCell(sheet, label, after, false, !tables.optional());
    while (currentCell != null) {
        // 1 table object instance
        Object obj = tables.tableClass().newInstance();
        // LabeledCellをマッピング
        processSingleLabelledCell(sheet, obj, currentCell, reader, process);
        // HorizontalRecordsをマッピング
        processMultipleTableCell(sheet, obj, currentCell, reader, tables, process);
        // VerticalRecordsをマッピング
        processMultipleTableCellForVertical(sheet, obj, currentCell, reader, tables, process);
        resultTableList.add(obj);
        after = currentCell;
        currentCell = Utils.getCell(sheet, label, after, false, false);
    }
    return resultTableList;
}
 
開發者ID:ctc-g,項目名稱:sinavi-jfw,代碼行數:32,代碼來源:JxIterateTableProcessor.java

示例5: doProcess

import net.java.amateras.xlsbeans.NeedPostProcess; //導入依賴的package包/類
public void doProcess(WSheet wSheet, Object obj,
		Method setter, Annotation ann, AnnotationReader reader,
		List<NeedPostProcess> needPostProcess) throws Exception {

	Cell cell = (Cell)ann;
	Utils.setPosition(cell.column(), cell.row(), obj, Utils.toPropertyName(setter.getName()));

	WCell wCell = wSheet.getCell(cell.column(), cell.row());
	Utils.invokeSetter(setter, obj, wCell.getContents());
}
 
開發者ID:otsecbsol,項目名稱:linkbinder,代碼行數:11,代碼來源:CellProcessor.java

示例6: createTables

import net.java.amateras.xlsbeans.NeedPostProcess; //導入依賴的package包/類
protected List<?> createTables(WSheet wSheet, IterateTables iterateTables ,
        AnnotationReader reader,  List<NeedPostProcess> needPostProcess) throws Exception {
    List<Object> resultTableList = new ArrayList<Object>();

    WCell after = null;
    WCell currentCell = null;
    String label = iterateTables.tableLabel();
    currentCell = Utils.getCell(wSheet, label, after, false, !iterateTables.optional());
    while (currentCell != null) {
        // 1 table object instance
        Object tableObj = iterateTables.tableClass().newInstance();

        // process single label.
        processSingleLabelledCell(wSheet, tableObj, currentCell, reader,
                needPostProcess);
        // process horizontal table.
        processMultipleTableCell(wSheet, tableObj, currentCell, reader,
                iterateTables, needPostProcess);

        // TODO process vertical table

        resultTableList.add(tableObj);
        after = currentCell;
        currentCell = Utils.getCell(wSheet, label, after, false, false);
    }
    return resultTableList;
}
 
開發者ID:otsecbsol,項目名稱:linkbinder,代碼行數:28,代碼來源:IterateTablesProcessor.java

示例7: doProcess

import net.java.amateras.xlsbeans.NeedPostProcess; //導入依賴的package包/類
public void doProcess(WSheet wSheet, Object obj, Method setter, Annotation ann, AnnotationReader reader,
		XLSBeansConfig config, List<NeedPostProcess> needPostProcess) throws Exception {
	Cell cell = (Cell)ann;
	Utils.setPosition(cell.column(), cell.row(), obj, Utils.toPropertyName(setter.getName()));

	WCell wCell = wSheet.getCell(cell.column(), cell.row());
	Utils.invokeSetter(setter, obj, wCell.getContents(), config);
}
 
開發者ID:takezoe,項目名稱:xlsbeans,代碼行數:9,代碼來源:CellProcessor.java

示例8: processSingleLabelledCell

import net.java.amateras.xlsbeans.NeedPostProcess; //導入依賴的package包/類
protected void processSingleLabelledCell(WSheet wSheet, Object tableObj, WCell headerCell, AnnotationReader reader,
                                         XLSBeansConfig config, List<NeedPostProcess> needPostProcess) throws Exception {

    List<Object> properties = Utils.getPropertiesWithAnnotation(tableObj, reader, LabelledCell.class);

    LabelledCellProcessor labelledCellProcessor = new LabelledCellProcessor();
    for (Object property : properties) {
        LabelledCell ann = null;
        if(property instanceof Method){
        	ann = reader.getAnnotation(tableObj.getClass(), (Method) property, LabelledCell.class);

        } else if(property instanceof Field){
        	ann = reader.getAnnotation(tableObj.getClass(), (Field) property, LabelledCell.class);
        }

        WCell titleCell = null;
        try {
            titleCell = Utils.getCell(wSheet, ann.label(), headerCell, config);
        } catch (XLSBeansException e) {
            if (ann.optional()) {
                continue;
            } else {
                throw e;
            }
        }

        LabelledCell labelledCell = new LabelledCellForIterateTable(ann, titleCell.getRow(), titleCell.getColumn());

        if(property instanceof Method){
         labelledCellProcessor.doProcess(wSheet, tableObj, (Method) property, labelledCell, reader, config, needPostProcess);

        } else if(property instanceof Field){
         labelledCellProcessor.doProcess(wSheet, tableObj, (Field) property, labelledCell, reader, config, needPostProcess);
        }
    }
}
 
開發者ID:takezoe,項目名稱:xlsbeans,代碼行數:37,代碼來源:IterateTablesProcessor.java

示例9: processMultipleTableCell

import net.java.amateras.xlsbeans.NeedPostProcess; //導入依賴的package包/類
protected void processMultipleTableCell(WSheet wSheet, Object tableObj, WCell headerCell, AnnotationReader reader,
        IterateTables iterateTables, XLSBeansConfig config, List<NeedPostProcess> needPostProcess) throws Exception {

    List<Object> properties = Utils.getPropertiesWithAnnotation(tableObj, reader, HorizontalRecords.class);

    int headerColumn = headerCell.getColumn();
    int headerRow = headerCell.getRow();

    if (iterateTables.bottom() > 0) {
        // if positive value set to bottom(), row index of table header move
        headerRow += iterateTables.bottom();
    }

    HorizontalRecordsProcessor processor = new HorizontalRecordsProcessor();
    for (Object property : properties) {
        HorizontalRecords ann = null;
        if(property instanceof Method){
        	ann = reader.getAnnotation(tableObj.getClass(), (Method) property, HorizontalRecords.class);

        } else if(property instanceof Field){
        	ann = reader.getAnnotation(tableObj.getClass(), (Field) property, HorizontalRecords.class);
        }

        if (iterateTables.tableLabel().equals(ann.tableLabel())) {
        	//
            HorizontalRecords records = new HorizontalRecordsForIterateTable(ann, headerColumn, headerRow);

            // horizontal record-mapping
            if(property instanceof Method){
             processor.doProcess(wSheet, tableObj, (Method) property, records, reader, config, needPostProcess);

            } else if(property instanceof Field){
             processor.doProcess(wSheet, tableObj, (Field) property, records, reader, config, needPostProcess);
            }
        }
    }
}
 
開發者ID:takezoe,項目名稱:xlsbeans,代碼行數:38,代碼來源:IterateTablesProcessor.java

示例10: processMultipleTableCellForVertical

import net.java.amateras.xlsbeans.NeedPostProcess; //導入依賴的package包/類
/**
 * VerticalRecordsのマッピングを行います。
 * @param sheet シート
 * @param tableObj オブジェクト
 * @param headerCell ヘッダセル
 * @param reader リーダ
 * @param iterateTables IterateTablesアノテーションの定義
 * @param needPostProcess プロセッサ
 * @throws Exception 予期しない例外
 */
protected void processMultipleTableCellForVertical(WSheet sheet, Object tableObj, WCell headerCell,
    AnnotationReader reader, IterateTables iterateTables, List<NeedPostProcess> needPostProcess) throws Exception {
    List<Object> properties = Utils.getPropertiesWithAnnotation(tableObj, reader, JxVerticalRecords.class);
    int headerColumn = headerCell.getColumn();
    int headerRow = headerCell.getRow();
    if (iterateTables.bottom() > 0) {
        headerRow += iterateTables.bottom();
    }
    JxVerticalRecordsProcessor processor = new JxVerticalRecordsProcessor();
    for (Object property : properties) {
        JxVerticalRecords ann = null;
        if (property instanceof Method) {
            ann = reader.getAnnotation(tableObj.getClass(), (Method) property, JxVerticalRecords.class);
        } else if (property instanceof Field) {
            ann = reader.getAnnotation(tableObj.getClass(), (Field) property, JxVerticalRecords.class);
        }
        if (ann != null && ann.tableLabel().equals(iterateTables.tableLabel())) {
            JxVerticalRecords records = new JxVerticalRecordsForIterateTable(ann, headerColumn, headerRow);
            if (property instanceof Method) {
                processor.doProcess(sheet, tableObj, (Method) property, records, reader, needPostProcess);
            } else if (property instanceof Field) {
                processor.doProcess(sheet, tableObj, (Field) property, records, reader, needPostProcess);
            }
        }
    }
}
 
開發者ID:ctc-g,項目名稱:sinavi-jfw,代碼行數:37,代碼來源:JxIterateTableProcessor.java

示例11: doProcess

import net.java.amateras.xlsbeans.NeedPostProcess; //導入依賴的package包/類
public void doProcess(WSheet wSheet, Object obj, Method setter,
		Annotation cell, AnnotationReader reader,
		List<NeedPostProcess> needPostProcess) throws Exception {

	Utils.invokeSetter(setter, obj, wSheet.getName());
}
 
開發者ID:otsecbsol,項目名稱:linkbinder,代碼行數:7,代碼來源:SheetNameProcessor.java

示例12: doProcess

import net.java.amateras.xlsbeans.NeedPostProcess; //導入依賴的package包/類
public void doProcess(WSheet wSheet, Object obj,
		Method setter, Annotation ann, AnnotationReader reader,
		List<NeedPostProcess> needPostProcess) throws Exception {
	doProcess(wSheet, obj, setter, null, ann, reader, needPostProcess);
}
 
開發者ID:otsecbsol,項目名稱:linkbinder,代碼行數:6,代碼來源:LabelledCellProcessor.java

示例13: doProcess

import net.java.amateras.xlsbeans.NeedPostProcess; //導入依賴的package包/類
public void doProcess(WSheet wSheet, Object obj,
Method setter, Annotation ann, AnnotationReader reader,
List<NeedPostProcess> needPostProcess) throws Exception ;
 
開發者ID:otsecbsol,項目名稱:linkbinder,代碼行數:4,代碼來源:FieldProcessor.java

示例14: processSingleLabelledCell

import net.java.amateras.xlsbeans.NeedPostProcess; //導入依賴的package包/類
protected void processSingleLabelledCell(WSheet wSheet, Object tableObj,
        WCell headerCell, AnnotationReader reader,
        List<NeedPostProcess> needPostProcess) throws Exception {

    List<Object> properties = Utils.getPropertiesWithAnnotation(
    		tableObj, reader, LabelledCell.class);

    LabelledCellProcessor labelledCellProcessor = new LabelledCellProcessor();
    for (Object property : properties) {
        LabelledCell ann = null;
        if(property instanceof Method){
        	ann = reader.getAnnotation(
        			tableObj.getClass(), (Method) property, LabelledCell.class);

        } else if(property instanceof Field){
        	ann = reader.getAnnotation(
        			tableObj.getClass(), (Field) property, LabelledCell.class);
        }

        WCell titleCell = null;
        try {
            titleCell = Utils.getCell(wSheet, ann.label(), headerCell);
        } catch (XLSBeansException e) {
            if (ann.optional()) {
                continue;
            } else {
                throw e;
            }
        }

        LabelledCell labelledCell = new LabelledCellForIterateTable(ann,
                titleCell.getRow(), titleCell.getColumn());

        if(property instanceof Method){
         labelledCellProcessor.doProcess(wSheet, tableObj,
         		(Method) property, labelledCell, reader, needPostProcess);

        } else if(property instanceof Field){
         labelledCellProcessor.doProcess(wSheet, tableObj,
         		(Field) property, labelledCell, reader, needPostProcess);
        }
    }
}
 
開發者ID:otsecbsol,項目名稱:linkbinder,代碼行數:44,代碼來源:IterateTablesProcessor.java

示例15: processMultipleTableCell

import net.java.amateras.xlsbeans.NeedPostProcess; //導入依賴的package包/類
protected void processMultipleTableCell(WSheet wSheet, Object tableObj,
        WCell headerCell, AnnotationReader reader,
        IterateTables iterateTables,
        List<NeedPostProcess> needPostProcess) throws Exception {

    List<Object> properties = Utils.getPropertiesWithAnnotation(
    		tableObj, reader, HorizontalRecords.class);

    int headerColumn = headerCell.getColumn();
    int headerRow = headerCell.getRow();

    if (iterateTables.bottom() > 0) {
        // if positive value set to bottom(), row index of table header move
        headerRow += iterateTables.bottom();
    }

    HorizontalRecordsProcessor processor = new HorizontalRecordsProcessor();
    for (Object property : properties) {
        HorizontalRecords ann = null;
        if(property instanceof Method){
        	ann = reader.getAnnotation(
        			tableObj.getClass(), (Method) property, HorizontalRecords.class);

        } else if(property instanceof Field){
        	ann = reader.getAnnotation(
        			tableObj.getClass(), (Field) property, HorizontalRecords.class);
        }

        if (iterateTables.tableLabel().equals(ann.tableLabel())) {
        	//
            HorizontalRecords records = new HorizontalRecordsForIterateTable(
                    ann,headerColumn, headerRow);

            // horizontal record-mapping
            if(property instanceof Method){
             processor.doProcess(wSheet, tableObj, (Method) property, records,
                     reader, needPostProcess);

            } else if(property instanceof Field){
             processor.doProcess(wSheet, tableObj, (Field) property, records,
                     reader, needPostProcess);
            }
        }
    }
}
 
開發者ID:otsecbsol,項目名稱:linkbinder,代碼行數:46,代碼來源:IterateTablesProcessor.java


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