dip.gui
Class HTMLFormat

java.lang.Object
  extended bydip.gui.HTMLFormat

public class HTMLFormat
extends java.lang.Object

Formats HTML text (or, really, any text) similar to MessageFormat but with the following features:

        1) pass a hashtable of key/value pairs
                keys MUST be String objects
                values can be any object that has a toString() method

        2) markup input text as follows:
                Simple Insertion:
                ================
                {name} = insert 'name', via the 'toString' method

                Formatted Insertion:
                ===================
                {date:name,}
                {decimal:name,}

                        specifiers are optional; locale-specific formatting used.

                Loops:
                =====
                {for:name

                        @@name@ 	<== insert name[position]
                }


                Reserved words:
                        "date:"
                        "decimal:"
                        "for:"
                Reserved Symbols:
                        "{", "}" 
                        '@' (in for loops only)



                what about arrays?
                index directly
                {name:3} 	3rd position of "name"
                {name:name2}  position "name2" in name (name2 must be an Integer)

                or:

                'for' loops for arrays
                {for:name
                        blah blah blah HTML here
                        @name (inserts name[i])
                }

                keywords:
                        for:name 			(uses array "name" for start/end)
                        for:start:end

                                                conditions is always "<"

                                                @@index 		current position
                                                @@indexplus	current position + 1 (for display purposes)
                                                @@variable@ 	
                                                @@variable@ 	



                        date:		// format-specifier: date
                        decimal: 	// format-specifier: decimal


Constructor Summary
protected HTMLFormat()
           
 
Method Summary
 java.lang.String format(java.lang.String html, java.util.Map map)
           
static HTMLFormat getInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLFormat

protected HTMLFormat()
Method Detail

getInstance

public static HTMLFormat getInstance()

format

public java.lang.String format(java.lang.String html,
                               java.util.Map map)


Copyright 2002-2004 Zachary DelProposto / jDip Development Team. All Rights Reserved.