JavaScript is disabled on your browser.
javolution.text

Class TextContext



  • public abstract class TextContext
    extends FormatContext 

    A context for plain text parsing/formatting. This context provides the TextFormat to parse/format objects of any class. If not superseded, the text format for a class is specified by the DefaultTextFormat annotation.

    A text context always returns the most specialized format. If the class has no default format annotation (inherited or not), then the default Object format (which calls Object.toString()) is returned. A predefined format exists for the following standard types:

    • java.lang.Object (parsing not supported, formatting calls toString())
    • java.lang.Boolean
    • java.lang.Character
    • java.lang.Byte
    • java.lang.Short
    • java.lang.Integer
    • java.lang.Long
    • java.lang.Float
    • java.lang.Double
    • java.lang.Class
    • java.lang.String
    • java.util.Date (ISO 8601)
    • java.math.BigInteger
    • java.math.BigDecimal
    • java.awt.Color (hexadecimal RGB value, e.g. 0x112233)
    • java.awt.Font

    Version:
    6.0 December 12, 2012
    Author:
    Jean-Marie Dautelle
    • Constructor Detail

      • TextContext

        protected TextContext()
        Default constructor.
    • Method Detail

      • enter

        public static TextContext enter()
        Enters and returns a new text context instance.
      • getFormat

        public static <T> TextFormat<T> getFormat(Class<? extends T> type)
        Returns the text format for the specified type. It is the most specialized format able to parse/format instances of the specified class. If there is no default format for the specified class, the standard object format (toString based) is returned.
      • setFormat

        public abstract <T> void setFormat(Class<? extends T> type,
         TextFormat<T> newFormat)
        Sets the text format for the specified type (and its sub-types).
      • searchFormat

        protected abstract <T> TextFormat<T> searchFormat(Class<? extends T> type)
        Searches the most specialized format for the specified type.

Copyright © 2005-2013 Javolution. All Rights Reserved.

AltStyle によって変換されたページ (->オリジナル) /