Invokes {@link #toMetaFunctions(Workbook, Class)} with {@link IDataModel} converted to {@link Workbook}.
7896
static <T extends FunctionMeta> Map<T, IDataModel> toMetaFunctions(IDataModel book, Class<T> metaClass) {
        return toMetaFunctions(DataModelConverters.toWorkbook(book), metaClass);
    }
693334
private void initWorkbook() throws Docx4JException
    {
        if(pkg == null)
            return;

        wbp = pkg.getWorkbookPart();
        sheets = ((org.xlsx4j.sml.Workbook)wbp.getJaxbElement()).getSheets().getSheet();
        wbrp = wbp.getRelationshipsPart();
        if(wbrp == null)
        {
            wbrp = new RelationshipsPart();
            wbrp.setPartName(new PartName("/xl/_rels/workbook.xml.rels"));

            //wbrp = new RelationshipsPart(new PartName("/xl/_rels/workbook.xml.rels"));
            wbp.addTargetPart(wbrp);
        }

        prp = pkg.getRelationshipsPart();
        if(prp == null)
        {
            prp = new RelationshipsPart();
            pkg.addTargetPart(prp);
        }

        PartName ssPart = new PartName("/xl/sharedStrings.xml");
        sharedStrings = (SharedStrings)pkg.getParts().get(ssPart);
        if(sharedStrings == null)
        {
            sharedStrings = new SharedStrings(ssPart);
            sharedStrings.setJaxbElement(new CTSst());
            wbp.addTargetPart(sharedStrings);
        }
        strings = sharedStrings.getJaxbElement();

        PartName stylesPart = new PartName("/xl/styles.xml");
        styles = (Styles)pkg.getParts().get(stylesPart);
        if(styles == null)
        {
            styles = new Styles(stylesPart);
            CTStylesheet styleSheet = new CTStylesheet();
            styles.setJaxbElement(styleSheet);
            wbp.addTargetPart(styles);
        }
        stylesheet = styles.getJaxbElement();

        fonts = stylesheet.getFonts();
        if(fonts == null)
        {
            fonts = new CTFonts();
            stylesheet.setFonts(fonts);
        }

        cellXfs = stylesheet.getCellXfs();
        if(cellXfs == null)
        {
            cellXfs = new CTCellXfs();
            stylesheet.setCellXfs(cellXfs);
        }

        cellStyles = stylesheet.getCellStyles();
        if(cellStyles == null)
        {
            cellStyles = new CTCellStyles();
            stylesheet.setCellStyles(cellStyles);
        }

        cellStyleXfs = stylesheet.getCellStyleXfs();
        if(cellStyleXfs == null)
        {
            cellStyleXfs = new CTCellStyleXfs();
            stylesheet.setCellStyleXfs(cellStyleXfs);
        }

        borders = stylesheet.getBorders();
        if(borders == null)
        {
            borders = new CTBorders();
            stylesheet.setBorders(borders);
        }

        fills = stylesheet.getFills();
        if(fills == null)
        {
            fills = new CTFills();
            stylesheet.setFills(fills);
        }

        if(sheets != null) 
        {
            for(int i = 0; i < sheets.size(); i++)
            {
                Sheet sheet = (Sheet)sheets.get(i);
                WorksheetPart wsp = (WorksheetPart)wbrp.getPart(sheet.getId());
                if(wsp != null)
                    worksheets.put(sheet.getName(), new XlsxWorksheet(this, wsp));
            }
        }

        //printFontInfo();
    }
935087
@Nonnull
	public <V extends T> LToDblFunctionBuilder<T> aCase(Class<V> argC, LToDblFunction<V> function) {
		PartialCaseWithDblProduct.The pc = partialCaseFactoryMethod(a -> (argC == null || argC.isInstance(a)));

		pc.evaluate(function);
		return self();
	}
573624
public void generate( IWTypeLib lib ) throws BindingException, IOException {
        LibBinder tli = getTypeLibInfo(lib);
        if(referenceResolver.suppress(lib))
            return; // skip code generation
        if(generatedTypeLibs.add(tli))
            tli.generate();
    }
1328722
def add_method(self, m, **kwargs):
        
        if isinstance(m, types.FunctionType):
            self['function', id(m)] = m
        else:
            f, obj = get_method_vars(m)
            wrkey = (f, id(obj))
            self[wrkey] = obj
217225
static IDataModel toDataModel(final IDataModel book, final ICellAddress address) {
        return toDataModel(DataModelConverters.toWorkbook(book), address);
    }
158650
static IDataModel toDataModel(final Workbook workbook) {
        if (workbook == null) { return null; }
        
        //add custom functions information
        workbook.addToolPack(getUdfFinder());
        
        Sheet s = workbook.getSheetAt(0); //TODO: only one sheet is supported
        if (s == null) { return null; }
        
        IDataModel dm = new DataModel(s.getSheetName());
        
        for (int i = s.getFirstRowNum(); i <= s.getLastRowNum(); i++) {
            Row r = s.getRow(i);
            if (r == null) { continue; }
            
            DmRow row = new DmRow(i);
            dm.setRow(i, row);
            
            for (int j = r.getFirstCellNum(); j < r.getLastCellNum(); j++) {
                Cell c = r.getCell(j);
                if (c == null) { continue; }
                
                DmCell cell = new DmCell();
                row.setCell(j, cell);
                
                cell.setAddress(new CellAddress(dm.getDataModelId(), A1Address.fromRowColumn(i, j)));
                cell.setContent(ConverterUtils.resolveCellValue(c));
            }
        }

        EvaluationWorkbook evaluationWbook = ConverterUtils.newEvaluationWorkbook(workbook);

        for (int nIdx = 0; nIdx < workbook.getNumberOfNames(); nIdx++) {
            Name name = workbook.getNameAt(nIdx);

            String reference = name.getRefersToFormula();
            if (reference == null) { continue; }

            if (A1Address.isAddress(removeSheetFromNameRef(reference))) {
                dm.setNamedAddress(name.getNameName(), A1Address.fromA1Address(removeSheetFromNameRef(reference)));
            } else if (isFormula(reference, evaluationWbook)) {
                dm.setNamedValue(name.getNameName(), new CellValue(FORMULA_PREFIX + reference));
            } else {
                dm.setNamedValue(name.getNameName(), CellValue.from(reference));
            }
        }

        return dm;
    }
794415
public static <T> DStreamJavaFunctions<T> javaFunctions(JavaDStream<T> dStream) {
        return new DStreamJavaFunctions<>(dStream.dstream());
    }
1265616
private static <T, G extends T> void generateDrawMethods(DexMaker dexMaker,
                                                             TypeId<G> generatedType,
                                                             TypeId<T> baseType) {
        generateDrawMethod(dexMaker, generatedType, baseType, ViewMethod.DRAW);
        generateDrawMethod(dexMaker, generatedType, baseType, ViewMethod.ON_DRAW);
    }
26402
static Workbook toWorkbook(final IDataModel dataModel, final Workbook formatting) {
        Workbook result = formatting == null ? ConverterUtils.newWorkbook() : ConverterUtils.clearContent(formatting);

        Sheet wbSheet = result.getSheet(dataModel.getName());
        if (wbSheet == null) { wbSheet = result.createSheet(dataModel.getName()); }

        dataModel.getNamedAddresses().forEach((k, v) -> {
            Name name = result.createName();
            name.setNameName(k);
            
            name.setRefersToFormula(createPoiNameRef(v.address(), dataModel.getName()));
        });

        dataModel.getNamedValues().forEach((k, v) -> {
            Name name = result.createName();
            name.setNameName(k);
            
            String refString = v.get() == null ? "" : v.get().toString();
            if (refString.startsWith(FORMULA_PREFIX)) { refString = refString.substring(1); }
            
            name.setRefersToFormula(refString);
        });

        for (int rowIdx = dataModel.getFirstRowIndex(); rowIdx <= dataModel.getLastRowIndex(); rowIdx++) {
            IDmRow dmRow = dataModel.getRow(rowIdx);
            if (dmRow == null) { continue; }
            Row wbRow = wbSheet.getRow(rowIdx);
            if (wbRow == null) { wbRow = wbSheet.createRow(rowIdx); }
            
            for (int cellIdx = dmRow.getFirstColumnIndex(); cellIdx <= dmRow.getLastColumnIndex(); cellIdx++) {
                IDmCell dmCell = dmRow.getCell(cellIdx);
                if (dmCell == null) { continue; }
                
                Cell wbCell = wbRow.getCell(cellIdx);
                if (wbCell == null) { wbCell = wbRow.createCell(cellIdx); }
                
                ConverterUtils.populateCellValue(wbCell, dmCell.getContent());
            }
        }

        return result;
    }
623952
static List<IDataModel> toDataModels(final InputStream book, final String function) {
        return toDataModels(ConverterUtils.newWorkbook(book), function);
    }
969995
function showInterfaceJavaMethod(intf, method, html) {
    var line = ""

    line += "\n    /**"
    line += "\n     * "
    line += "\n     */"
    line += "\n    <span class='methodName'>public void " + method.name + "</span>(" + getJavaParameterListSimple(method.parameters, method.returns) + ") throws IOException {"
    line += "\n        Main.warn(getClass().getName() + \"." + method.name + "() not implemented\");"
    line += "\n"
    line += "\n        channel.sendCallback(\"" + intf.name + "\", callbackId" + getJavaCallbackParameterListSimple(method.callbackParameters) + ");"
    line += "\n    }"
    line += "\n"
    html.push(line)
}
147647
private Object invoke(String methodName, Object returnValueIfNonExistent,
                          Class<?>[] paramTypes, Object[] params)
        throws DocletInvokeException {
            Method meth;
            try {
                meth = docletClass.getMethod(methodName, paramTypes);
            } catch (NoSuchMethodException exc) {
                if (returnValueIfNonExistent == null) {
                    messager.error(Messager.NOPOS, "main.doclet_method_not_found",
                                   docletClassName, methodName);
                    throw new DocletInvokeException();
                } else {
                    return returnValueIfNonExistent;
                }
            } catch (SecurityException exc) {
                messager.error(Messager.NOPOS, "main.doclet_method_not_accessible",
                               docletClassName, methodName);
                throw new DocletInvokeException();
            }
            if (!Modifier.isStatic(meth.getModifiers())) {
                messager.error(Messager.NOPOS, "main.doclet_method_must_be_static",
                               docletClassName, methodName);
                throw new DocletInvokeException();
            }
            ClassLoader savedCCL =
                Thread.currentThread().getContextClassLoader();
            try {
                if (appClassLoader != null) // will be null if doclet class provided via API
                    Thread.currentThread().setContextClassLoader(appClassLoader);
                return meth.invoke(null , params);
            } catch (IllegalArgumentException exc) {
                messager.error(Messager.NOPOS, "main.internal_error_exception_thrown",
                               docletClassName, methodName, exc.toString());
                throw new DocletInvokeException();
            } catch (IllegalAccessException exc) {
                messager.error(Messager.NOPOS, "main.doclet_method_not_accessible",
                               docletClassName, methodName);
                throw new DocletInvokeException();
            } catch (NullPointerException exc) {
                messager.error(Messager.NOPOS, "main.internal_error_exception_thrown",
                               docletClassName, methodName, exc.toString());
                throw new DocletInvokeException();
            } catch (InvocationTargetException exc) {
                Throwable err = exc.getTargetException();
                if (apiMode)
                    throw new ClientCodeException(err);
                if (err instanceof java.lang.OutOfMemoryError) {
                    messager.error(Messager.NOPOS, "main.out.of.memory");
                } else {
                    messager.error(Messager.NOPOS, "main.exception_thrown",
                               docletClassName, methodName, exc.toString());
                    exc.getTargetException().printStackTrace();
                }
                throw new DocletInvokeException();
            } finally {
                Thread.currentThread().setContextClassLoader(savedCCL);
            }
    }
739321
static IDataModel createDataModelFromCell(Sheet sheet, FormulaParsingWorkbook workbook, IA1Address address) {
        IDataModel dm = new DataModel(randomUUID().toString());
        resolveCellDependencies(address, sheet, workbook).forEach(cell -> ConverterUtils.copyCell(new CellAddress(dm.getDataModelId(), cell), sheet, dm));
        return dm;
    }
844900
private void processFunctions(String name, String text, String type,
      List<MtasCRMParserFunctionOutput> functionOutputList) {
    if (functions.containsKey(type) && functions.get(type).containsKey(name)
        && text != null) {
      MtasCRMParserFunction function = functions.get(type).get(name);
      String[] value;
      if (function.split != null) {
        value = text.split(Pattern.quote(function.split));
      } else {
        value = new String[] { text };
      }
      for (int c = 0; c < value.length; c++) {
        boolean checkedEmpty = false;
        if (value[c].equals("")) {
          checkedEmpty = true;
        }
        if (function.output.containsKey(value[c])) {
          ArrayList<MtasCRMParserFunctionOutput> list = function.output
              .get(value[c]);
          for (MtasCRMParserFunctionOutput listItem : list) {
            functionOutputList.add(listItem.create(value[c]));
          }
        }
        if (!checkedEmpty && function.output.containsKey("")) {
          ArrayList<MtasCRMParserFunctionOutput> list = function.output.get("");
          for (MtasCRMParserFunctionOutput listItem : list) {
            functionOutputList.add(listItem.create(value[c]));
          }
        }
      }
    }
  }
1058778
public void addMethodLine(String className, String methodName, String methodSignature, SourceLineRange range) {
        methodLineMap.put(new MethodDescriptor(className, methodName, methodSignature), range);
    }
354316
public static <T> void writeWorkBook(File file, int excelType, List<T> beans) throws WriteExcelException {
        WriteExcelUtils.writeWorkBook(file, excelType, beans, null);
    }