public class JDomUtility extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
addGenericAttribute(Element e,
String key,
Object v) |
static void |
addParagraphs(Element parent,
String childName,
String text) |
static String |
boolString(boolean value) |
static void |
checkName(Element e,
String expectedName) |
static boolean |
checkTriState(int v) |
static void |
clearNewLineElements(Element e) |
static String |
colorToString(Color color) |
static String |
dateToStringShortUS(Date date) |
static Font |
elementToFont(Element e) |
static Element |
fontToElement(Font font) |
static int[] |
getAlignment(Element e,
String id,
int[] defaultValue) |
static int[] |
getAlignProp(Element e,
String id,
int[] defaultValue) |
static boolean |
getBoolAttr(Element e,
String attr,
boolean defaultValue) |
static Boolean |
getBooleanAttr(Element e,
String attr,
Boolean defaultValue) |
static Element |
getChildWithId(Element e,
String name,
String id) |
static String |
getClassName(Element e) |
static Color |
getColorAttr(Element e,
String attr,
Color defaultValue) |
static Color |
getColorByPoint(Element e,
String id,
BufferedImage img,
Color defaultValue) |
static Date |
getDateAttrShortUS(Element e,
String attr,
Date defaultValue) |
static Dimension |
getDimension(Element e,
String id,
Dimension defaultValue) |
static Dimension |
getDimensionAttr(Element e,
String atrW,
String atrH,
Dimension defaultValue) |
static int |
getDirection(Element e,
int defaultValue) |
static double |
getDoubleAttr(Element e,
String attr,
double defaultValue) |
static float |
getFloatAttr(Element e,
String attr,
float defaultValue) |
static int |
getHAlign(Element e,
int defaultValue) |
static int |
getIntAttr(Element e,
String attr,
int defaultValue) |
static long |
getLongAttr(Element e,
String attr,
long defaultValue) |
static Point |
getOffset(Element e,
String id,
Point defaultValue) |
static String |
getParagraphs(Element e) |
static Point |
getPoint(Element e,
String id,
Point defaultValue) |
static Point |
getPointAttr(Element e,
String atrX,
String atrY,
Point defaultValue) |
static Rectangle |
getRectangle(Element e,
String id,
Rectangle defaultValue) |
static SAXBuilder |
getSAXBuilder() |
static int |
getStrIndexAttr(Element e,
String attr,
String[] values,
int defaultValue) |
static int |
getStrIndexAttr(String s,
String[] values,
int defaultValue) |
static String |
getStringAttr(Element e,
String attr,
String defaultValue,
boolean allowEmpty) |
static int |
getTriStateAttr(Element e,
String attr,
int defaultValue) |
static int |
getVAlign(Element e,
int defaultValue) |
static XMLOutputter |
getXMLOutputter() |
static String |
intArrayToString(int[] v) |
static String |
intArrayToString(int[] v,
int numElements) |
static boolean |
isDefaultAlign(int[] align) |
static void |
saveDocument(OutputStream out,
Document doc) |
static void |
saveDocument(OutputStream out,
Element rootElement) |
static void |
setAlignProp(Element e,
String id,
int[] align,
boolean omitIfDefault) |
static void |
setParagraphs(Element e,
String text) |
static void |
setStringAttr(Element e,
String key,
String value,
boolean allowEmpty) |
static Color |
stringToColor(String s) |
static int[] |
stringToIntArray(String s) |
static String |
triStateString(int state) |
public static final String ID
public static final String IMAGE
public static final String NAME
public static final String TYPE
public static final String BGCOLOR
public static final String FORECOLOR
public static final String MARGIN
public static final String BORDER
public static final String POSITION
public static final String X
public static final String Y
public static final String P
public static final String CLASS
public static final String FONT
public static final String[] HTML_COLOR_NAMES
public static final Color[] HTML_COLORS
public static final String LEFT
public static final String RIGHT
public static final String TOP
public static final String BOTTOM
public static final String WIDTH
public static final String HEIGHT
public static final String UP
public static final String DOWN
public static final String RECTANGLE
public static final String POINT
public static final String DIMENSION
public static final String OFFSET
public static final String COLOR
public static final String VALUE
public static final String DIRECTION
public static final int DIRECTION_UP
public static final int DIRECTION_DOWN
public static final int DIRECTION_LEFT
public static final int DIRECTION_RIGHT
public static final String[] directionName
public static final String ALIGNMENT
public static final String HALIGN
public static final String VALIGN
public static final int ALIGN_LEFT
public static final int ALIGN_TOP
public static final int ALIGN_MIDDLE
public static final int ALIGN_RIGHT
public static final int ALIGN_BOTTOM
public static final String[] hAlignName
public static final String[] vAlignName
public static final int[] DEFAULT_ALIGNMENT
public static final String[] BOOL_STR
public static final int FALSE
public static final int TRUE
public static final int DEFAULT
public static final String NEWLINE
public static final String BLANK
public static Color getColorAttr(Element e, String attr, Color defaultValue) throws Exception
Exception
public static Color getColorByPoint(Element e, String id, BufferedImage img, Color defaultValue) throws Exception
Exception
public static int getDirection(Element e, int defaultValue) throws Exception
Exception
public static int getHAlign(Element e, int defaultValue) throws Exception
Exception
public static int getVAlign(Element e, int defaultValue) throws Exception
Exception
public static int[] getAlignment(Element e, String id, int[] defaultValue) throws Exception
Exception
public static int[] getAlignProp(Element e, String id, int[] defaultValue) throws Exception
Exception
public static void setAlignProp(Element e, String id, int[] align, boolean omitIfDefault)
public static boolean isDefaultAlign(int[] align)
public static String intArrayToString(int[] v)
public static String intArrayToString(int[] v, int numElements)
public static String triStateString(int state)
public static int getTriStateAttr(Element e, String attr, int defaultValue) throws Exception
Exception
public static boolean checkTriState(int v)
public static String boolString(boolean value)
public static String getStringAttr(Element e, String attr, String defaultValue, boolean allowEmpty)
public static void setStringAttr(Element e, String key, String value, boolean allowEmpty)
public static int getStrIndexAttr(Element e, String attr, String[] values, int defaultValue) throws Exception
Exception
public static int getStrIndexAttr(String s, String[] values, int defaultValue) throws Exception
Exception
public static Dimension getDimensionAttr(Element e, String atrW, String atrH, Dimension defaultValue)
public static Point getPointAttr(Element e, String atrX, String atrY, Point defaultValue)
public static Date getDateAttrShortUS(Element e, String attr, Date defaultValue) throws Exception
Exception
public static void clearNewLineElements(Element e)
public static SAXBuilder getSAXBuilder()
public static void saveDocument(OutputStream out, Element rootElement) throws Exception
Exception
public static void saveDocument(OutputStream out, Document doc) throws Exception
Exception
public static XMLOutputter getXMLOutputter()
public static void checkName(Element e, String expectedName) throws Exception
Exception
Copyright © 2004-15 Francesc Busquets (fbusquets@xtec.cat) & Departament d'Educació de la Generalitat de Catalunya (info@xtec.cat)
Licensed under the terms of the GNU General Public License.