Examples of Formatter


Examples of net.sourceforge.stripes.format.Formatter

    protected String format(Object value) {
        if (value == null) {
            return "";
        }
        else {
            Formatter formatter = getFormatter(value);
            if (formatter == null)
                return value.toString();
            else
                return formatter.format(value);
        }
    }
View Full Code Here

Examples of net.thucydides.core.reports.html.Formatter

    public String getTitleWithLinks() {
        return getFormatter().addLinks(getTitle());
    }

    private Formatter getFormatter() {
        return new Formatter(issueTracking);
    }
View Full Code Here

Examples of org.apache.beehive.netui.tags.html.FormatTag.Formatter

        for(int i = 0; i < _formatters.size(); i++) {
            assert _formatters.get(i) instanceof Formatter :
                    "Found invalid formatter type \"" +
                    (_formatters.get(i) != null ? _formatters.get(i).getClass().getName() : "null") + "\"";

            Formatter formatter = (Formatter)_formatters.get(i);
            assert formatter != null;
            try {
                formatted = formatter.format(formatted);
            }
            catch(JspException e) {
                /* todo: v1 -- error reporting */
                LOGGER.error(Bundle.getErrorString("CellModel_FormatterThrewException", new Object[]{formatter.getClass().getName(), e}), e);
            }
        }

        assert formatted != null;
        return formatted.toString();
View Full Code Here

Examples of org.apache.log.format.Formatter

        final String contextkey =
            m_configuration.getAttribute( "context-key", "servlet-context" );
        final ServletContext sctx;

        final Configuration confFormat = configuration.getChild( "format" );
        final Formatter formatter = getFormatter( confFormat );

        try
        {
            sctx = (ServletContext)m_context.get( contextkey );
        }
View Full Code Here

Examples of org.apache.lucene.search.highlight.Formatter

    /**
     * Add snippets to the search-results. It adds a new field
     * SNIPPET_FIELDNAME_PREFIX_field with the snippet for each field
     */
    private void addSnippets (GroupedSearchResults res, org.apache.lucene.search.Query query) throws IOException {   
        Formatter simpleHtmlFormatter= new SimpleHTMLFormatter(HIGHLIGHTER_PREFIX, HIGHLIGHTER_SUFFIX);
        for (int i= 0; i < snippetOfFields.length; i++) {
            String fieldToSnippet = snippetOfFields[i];  
            int snippetLength= snippetsLength[i];
            QueryScorer scorer= new QueryScorer(query, fieldToSnippet);
            addSnippets(res, fieldToSnippet, snippetLength, scorer, simpleHtmlFormatter);
View Full Code Here

Examples of org.apache.mahout.math.matrix.doublealgo.Formatter

   * Returns a string representation using default formatting.
   *
   * @see org.apache.mahout.math.matrix.doublealgo.Formatter
   */
  public String toString() {
    return new Formatter().toString(this);
  }
View Full Code Here

Examples of org.apache.myfaces.extensions.cdi.message.api.Formatter

    {
        StringBuffer result = new StringBuffer();

        Serializable argument;
        Serializable[] arguments = message.getArguments();
        Formatter formatter;

        if(arguments == null || arguments.length == 0)
        {
            return "";
        }

        for(int i = 0; i < arguments.length; i++)
        {
            if(i == 0)
            {
                result.append(" (");
            }
            else
            {
                result.append(",");
            }

            argument = arguments[i];
            formatter = this.messageContext.config().getFormatterFactory().findFormatter(argument.getClass());

            if (formatter != null && !isDefaultFormatter(formatter.getClass()))
            {
                //noinspection unchecked
                result.append(formatter.format(this.messageContext, argument));
            }
            else if(argument instanceof Localizable)
            {
                result.append(((Localizable)argument).toString(this.messageContext));
            }
            else
            {
                //use default formatter (if available)
                if(formatter != null)
                {
                    //noinspection unchecked
                    result.append(formatter.format(this.messageContext, argument));
                }
                else
                {
                    result.append(argument.toString());
                }
View Full Code Here

Examples of org.eclipse.assemblyformatter.ir.Formatter

      // MessageDialog.openInformation(shell, "Editor part",
      // "Found active editor");
      ITextEditor editor = (ITextEditor) part;
      IDocumentProvider dp = editor.getDocumentProvider();
      IDocument doc = dp.getDocument(editor.getEditorInput());
      Formatter formatter = new Formatter(doc);

      try {
        formatter.replaceAnyTab(8);
      } catch (BadLocationException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      }

      final String directory = "E:\\assembly-formatter\\debug\\";
      formatter.tokenize();
      try {
        formatter.writeSectionList(directory
            + "section-list tokenize().xml");
      } catch (ParserConfigurationException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      } catch (IOException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      } catch (TransformerException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      }

      try {
        formatter.parse();
      } catch (BadLocationException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      }

      try {
        formatter.writeSectionList(directory
            + "section-list parse().xml");
      } catch (ParserConfigurationException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      } catch (IOException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      } catch (TransformerException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      }

      try {
        formatter.rewrite();
      } catch (BadLocationException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      }

      try {
        formatter.writeSectionList(directory
            + "section-list format().xml");
      } catch (ParserConfigurationException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      } catch (IOException e) {
View Full Code Here

Examples of org.geotools.referencing.wkt.Formatter

            indentation = Preferences.userNodeForPackage(org.geotools.referencing.wkt.Formattable.class)
                    .getInt("Indentation", indentation);
        } catch (SecurityException ignore) {
            // Ignore. Will fallback on the default indentation.
        }
        final Formatter formatter = new Formatter(Symbols.DEFAULT, indentation);
        formatter.append(this);
        return formatter.toString();
    }
View Full Code Here

Examples of org.hibernate.pretty.Formatter

    }
  }

  private String format(String sql) {
    if ( factory.getSettings().isFormatSqlEnabled() ) {
      return new Formatter(sql).format();
    }
    else {
      return sql;
    }
  }
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.