Package net.java.textilej.parser.markup

Examples of net.java.textilej.parser.markup.Dialect


    return null;
  }

  private Dialect instantiateDialect(String name, Class<? extends Dialect> dialectClass) {
    try {
      Dialect dialect = dialectClass.newInstance();
      dialect.setName(name);
      return dialect;
    } catch (Exception e) {
      log(IStatus.ERROR,String.format("Cannot instantiate dialect '%' (class '%s'): %s",name,dialectClass.getName(),e.getMessage()),e);
    }
    return null;
View Full Code Here


            }
            if (!(dialect instanceof Dialect)) {
              log(IStatus.ERROR,String.format("%s is not a dialect",dialect.getClass().getName()));
              continue;
            }
            Dialect d = (Dialect) dialect;
            {
              Class<? extends Dialect> previous = dialectByName.put(name, d.getClass());
              if (previous != null) {
                log(IStatus.ERROR,String.format(EXTENSION_MARKUP_DIALECT+"/@name '%s' specified by plugin '%s' is ignored: name '%s' is already registered",name,element.getDeclaringExtension().getContributor().getName(),name));
                dialectByName.put(name, previous);
                continue;
              }
            }
            String fileExtensions = element.getAttribute("fileExtensions");
            if (fileExtensions != null) {
              String[] parts = fileExtensions.split("\\s*,\\s*");
              for (String part: parts) {
                if (part.length() != 0) {
                  Class<? extends Dialect> previous = dialectByFileExtension.put(part, d.getClass());
                  if (previous != null) {
                    log(IStatus.ERROR,String.format(EXTENSION_MARKUP_DIALECT+"/@fileExtensions '%s' specified by plugin '%s' is ignored: extension '%s' is already registered",part,element.getDeclaringExtension().getContributor().getName(),part));
                    dialectByFileExtension.put(part, previous);
                    continue;
                  }
View Full Code Here

TOP

Related Classes of net.java.textilej.parser.markup.Dialect

Copyright © 2018 www.massapicom. 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.