Examples of TemplateDocument


Examples of cambridge.model.TemplateDocument

    * @return Returns the newly created TemplateFactory
    * @throws TemplateLoadingException
    */
   public TemplateFactory newTemplateFactory(String template, ExpressionLanguage expressionLanguage) throws TemplateLoadingException {
      InputStream in = classLoader.getResourceAsStream(template);
      TemplateDocument doc = parseTemplate(in, expressionLanguage);
      try {
         FragmentList fragments = doc.normalize();
         return new ImmutableTemplateFactory(this, fragments);
      } catch (BehaviorInstantiationException e) {
         throw new TemplateLoadingException(e);
      }
   }
View Full Code Here

Examples of cambridge.model.TemplateDocument

    * @return Returns the newly created TemplateFactory
    * @throws TemplateLoadingException
    */
   public TemplateFactory newTemplateFactory(String template, String encoding, ExpressionLanguage expressionLanguage) throws TemplateLoadingException {
      InputStream in = classLoader.getResourceAsStream(template);
      TemplateDocument doc = parseTemplate(in, encoding, expressionLanguage);
      try {
         FragmentList fragments = doc.normalize();
         return new ImmutableTemplateFactory(this, fragments);
      } catch (BehaviorInstantiationException e) {
         throw new TemplateLoadingException(e);
      }
   }
View Full Code Here

Examples of cambridge.model.TemplateDocument

    * @return Returns the newly created TemplateFactory
    * @throws TemplateLoadingException
    */
   public TemplateFactory newTemplateFactory(String template, TemplateModifier modifier, ExpressionLanguage expressionLanguage) throws TemplateLoadingException {
      InputStream in = classLoader.getResourceAsStream(template);
      TemplateDocument doc = parseTemplate(in, expressionLanguage);
      modifier.modifyTemplate(doc);
      try {
         FragmentList fragments = doc.normalize();
         return new ImmutableTemplateFactory(this, fragments);
      } catch (BehaviorInstantiationException e) {
         throw new TemplateLoadingException(e);
      }
   }
View Full Code Here

Examples of cambridge.model.TemplateDocument

    * @return Returns the newly created TemplateFactory
    * @throws TemplateLoadingException
    */
   public TemplateFactory newTemplateFactory(String template, String encoding, TemplateModifier modifier, ExpressionLanguage expressionLanguage) throws TemplateLoadingException {
      InputStream in = classLoader.getResourceAsStream(template);
      TemplateDocument doc = parseTemplate(in, encoding, expressionLanguage);
      modifier.modifyTemplate(doc);
      try {
         FragmentList fragments = doc.normalize();
         return new ImmutableTemplateFactory(this, fragments);
      } catch (BehaviorInstantiationException e) {
         throw new TemplateLoadingException(e);
      }
   }
View Full Code Here

Examples of cambridge.model.TemplateDocument

    {
        FileTemplateLoader l = (FileTemplateLoader) loader;
        try
        {
            reloading = true;
            TemplateDocument doc = l.parseTemplate(templateFile, encoding, expressionLanguage);
            if (modifier != null)
            {
                modifier.modifyTemplate(doc);
            }

            if (doc.getIncludes() != null)
            {
                includes = l.getFiles(doc.getIncludes());
            }

            fragments = doc.normalize();

            lastReload = System.currentTimeMillis();
        }
        catch (TemplateLoadingException e)
        {
View Full Code Here

Examples of cambridge.model.TemplateDocument

    * @param cl The TagNode implementation class.
    * @return Returns the newly created tag node object which contains the template contents.
    * @throws TemplateLoadingException Might be thrown if there is a problem in parsing the provided template.
    */
   public <T extends TagNode> T createTag(InputStream in, Class<T> cl, ExpressionLanguage expressionLanguage) throws TemplateLoadingException {
      TemplateDocument doc = loader.parseTemplate(in, expressionLanguage);
      ArrayList<TemplateNode> nodes = doc.getChildren();

      try {
         T tag = cl.newInstance();
         tag.addChildren(nodes);
         return tag;
View Full Code Here

Examples of cambridge.model.TemplateDocument

    * @param cl The TagNode implementation class.
    * @return Returns the newly created tag node object which contains the template contents.
    * @throws TemplateLoadingException Might be thrown if there is a problem in parsing the provided template.
    */
   public <T extends TagNode> T createTag(File tagTemplate, Class<T> cl, ExpressionLanguage expressionLanguage) throws TemplateLoadingException {
      TemplateDocument doc = loader.parseTemplate(tagTemplate, expressionLanguage);
      ArrayList<TemplateNode> nodes = doc.getChildren();

      try {
         T tag = cl.newInstance();
         tag.addChildren(nodes);
         return tag;
View Full Code Here

Examples of edu.pitt.dbmi.nlp.noble.extract.model.TemplateDocument

  private void process(List<Template> templates,File reportFile) throws Exception {
    progress("processing report ("+(processCount+1)+") "+reportFile.getName()+" ... ");
   
    // read in the report, do first level proce
    String text = TextTools.getText(new FileInputStream(reportFile));
    TemplateDocument doc = new TemplateDocument();
    doc.setTitle(reportFile.getName());
    doc.setLocation(reportFile.getAbsolutePath());
    doc.setText(text);
    doc.addTemplates(templates);
    doc.setDocumentType(DocumentProcessor.suggestDocumentType(text));
    //doc.getFilters().addAll(DocumentFilter.getDeIDFilters());
   
    // do information extraction
    process(doc);
   
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.