Examples of ClassLocator


Examples of org.zkoss.util.resource.ClassLocator

      if (_defURLs != null)
        return _defURLs;

      final Map urls = new HashMap();
      try {
        final ClassLocator loc = new ClassLocator();
        for (Enumeration en = loc.getResources("metainfo/tld/config.xml");
        en.hasMoreElements();) {
          final URL url = (URL)en.nextElement();
          if (log.debugable()) log.debug("Loading "+url);
          try {
            final Document doc = new SAXBuilder(false, false, true).build(url);
View Full Code Here

Examples of org.zkoss.util.resource.ClassLocator

      //get the class name
      log.info("Loading labels for "+locale);
      final Map labels = new HashMap(512);

      //1. load from modules
      final ClassLocator locator = new ClassLocator();
      for (Enumeration en = locator.getResources(
        locale == null ? "metainfo/i3-label.properties":
        "metainfo/i3-label_" + locale + ".properties");
      en.hasMoreElements();) {
        final URL url = (URL)en.nextElement();
        load(labels, url, _jarcharset);
View Full Code Here

Examples of org.zkoss.util.resource.ClassLocator

 
  private XelContext getXelContext() {
    Taglib taglib = new Taglib("", "/web/WEB-INF/tld/zss/function.tld");
    List taglibs = new ArrayList(1);
    taglibs.add(taglib);
    FunctionMapper mapper = Taglibs.getFunctionMapper(taglibs, new ClassLocator());
    return new SimpleXelContext(null, mapper);
  }
View Full Code Here

Examples of org.zkoss.util.resource.ClassLocator

    _mappers = new LinkedHashSet(4);
   
    //prepare the default Spread Sheet function mapper.
    final List taglibs = new ArrayList(1);
    taglibs.add(SSTAGLIB);
    FunctionMapper mapper = Taglibs.getFunctionMapper(taglibs, new ClassLocator());
    addFunctionMapper(mapper);
  }
View Full Code Here

Examples of org.zkoss.util.resource.ClassLocator

                url = file.toURI().toURL();
            } else
              url = wapp.getResource(_src);
          }
          if (url == null) {// try to load from class loader
            url = new ClassLocator().getResource(_src);
          }
          if (url == null) {// try to load from file
            File f = new File(_src);
            if (f.exists()) {
              url = f.toURI().toURL();
View Full Code Here

Examples of org.zkoss.util.resource.ClassLocator

   * @throws java.lang.Exception
   */
  @Before
  public void setUp() throws Exception {
    final String filename = "Book13.xls";
    final InputStream is = new ClassLocator().getResourceAsStream(filename);
    _workbook = new ExcelImporter().imports(is, filename);
    assertTrue(_workbook instanceof Book);
    assertTrue(_workbook instanceof HSSFBookImpl);
    assertTrue(_workbook instanceof HSSFWorkbook);
    assertEquals(filename, ((Book)_workbook).getBookName());
View Full Code Here

Examples of org.zkoss.util.resource.ClassLocator

   * @throws java.lang.Exception
   */
  @Before
  public void setUp() throws Exception {
    final String filename = "Book8.xls";
    final InputStream is = new ClassLocator().getResourceAsStream(filename);
    _workbook = new ExcelImporter().imports(is, filename);
    assertTrue(_workbook instanceof Book);
    assertTrue(_workbook instanceof HSSFBookImpl);
    assertTrue(_workbook instanceof HSSFWorkbook);
    assertEquals(filename, ((Book)_workbook).getBookName());
View Full Code Here

Examples of org.zkoss.util.resource.ClassLocator

   * @throws java.lang.Exception
   */
  @Before
  public void setUp() throws Exception {
    final String filename = "Book5.xlsx";
    final InputStream is = new ClassLocator().getResourceAsStream(filename);
    _workbook = new ExcelImporter().imports(is, filename);
    assertTrue(_workbook instanceof Book);
    assertTrue(_workbook instanceof XSSFBookImpl);
    assertTrue(_workbook instanceof XSSFWorkbook);
    assertEquals(filename, ((Book)_workbook).getBookName());
View Full Code Here

Examples of org.zkoss.util.resource.ClassLocator

   * @throws java.lang.Exception
   */
  @Before
  public void setUp() throws Exception {
    final String filename = "Book14.xlsx";
    final InputStream is = new ClassLocator().getResourceAsStream(filename);
    _workbook = new ExcelImporter().imports(is, filename);
    assertTrue(_workbook instanceof Book);
    assertTrue(_workbook instanceof XSSFBookImpl);
    assertTrue(_workbook instanceof XSSFWorkbook);
    assertEquals(filename, ((Book)_workbook).getBookName());
View Full Code Here

Examples of org.zkoss.util.resource.ClassLocator

   * @throws java.lang.Exception
   */
  @Before
  public void setUp() throws Exception {
    final String filename = "Book3.xls";
    final InputStream is = new ClassLocator().getResourceAsStream(filename);
    _workbook = new ExcelImporter().imports(is, filename);
    assertTrue(_workbook instanceof Book);
    assertTrue(_workbook instanceof HSSFBookImpl);
    assertTrue(_workbook instanceof HSSFWorkbook);
    assertEquals(filename, ((Book)_workbook).getBookName());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.