|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.enough.polish.preprocess.css.Converter
public class Converter
Base class for several Creator classes.
Copyright Enough Software 2004 - 2011
history
10-Mar-2004 - rob creation
| Field Summary | |
|---|---|
static Map<String,String> |
ANCHORS
|
protected ColorConverter |
colorConverter
|
protected static String |
STANDALONE_MODIFIER
|
protected static String |
STANDALONE_MODIFIER_NON_FINAL
|
| Constructor Summary | |
|---|---|
Converter()
Creates a new instance. |
|
| Method Summary | |
|---|---|
static String |
getUrl(String url)
Extracts the correct url from the given resource URL. |
boolean |
isAlphaColor(String color)
Determines whether the given color has a defined alpha channel. |
String |
parseAnchor(String styleName,
String groupName,
String attributeName,
String anchorValue)
Parses the given anchor value. |
boolean |
parseBoolean(String styleName,
String groupName,
String name,
String value)
Parses the given boolean value. |
String |
parseColor(String value)
Parses the given color. |
float |
parseFloat(String styleName,
String groupName,
String name,
String value)
Parse the given number into a float. |
static int |
parseInt(String styleName,
String groupName,
String name,
String value)
Parses the given integer. |
int |
parseInt(String styleName,
String groupName,
String name,
String value,
int relativeValue)
Parses the given number which can be a percentage value. |
String |
parseStroke(String styleName,
String groupName,
String name,
String value)
Parse the given stroke setting |
void |
print(Map attributes)
Prints the specified attributes for logging purposes |
void |
setColorConverter(ColorConverter colorConverter)
Sets the color converter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String STANDALONE_MODIFIER
protected static final String STANDALONE_MODIFIER_NON_FINAL
protected ColorConverter colorConverter
public static final Map<String,String> ANCHORS
| Constructor Detail |
|---|
public Converter()
| Method Detail |
|---|
public void setColorConverter(ColorConverter colorConverter)
colorConverter - the initialised color converter
public static final int parseInt(String styleName,
String groupName,
String name,
String value)
styleName - the style namegroupName - the name of the groupname - the name of the fieldvalue - the int value as a String
BuildException - when the value could not be parsed.
public boolean parseBoolean(String styleName,
String groupName,
String name,
String value)
styleName - the style namegroupName - the name of the groupname - the name of the fieldvalue - the boolean value as a String
BuildException - when the value could not be parsed.
public int parseInt(String styleName,
String groupName,
String name,
String value,
int relativeValue)
styleName - the style namegroupName - the name of the groupname - the name of the fieldvalue - the int or percentage value as a String. A percentage value needs
to end with a "%" character.relativeValue - the number representing 100% if a percentage value is given.
BuildException - when the value could not be parsed or when a percentage value
is given and the given relativeValue is -1.
public float parseFloat(String styleName,
String groupName,
String name,
String value)
styleName - the style namegroupName - the name of the groupname - the name of the fieldvalue - the float value as a String.
BuildException - when the value could not be parsed.
public String parseStroke(String styleName,
String groupName,
String name,
String value)
styleName - the style namegroupName - the name of the groupname - the name of the fieldvalue - the float value as a String.
BuildException - when the value could not be parsed.public static final String getUrl(String url)
url - the URL of the resource, e.g. "url( myPic.png )"
NullPointerException - when the url is nullpublic String parseColor(String value)
value - the color, e.g. "rgb( 12, 12, 12 )" or "red"
public String parseAnchor(String styleName,
String groupName,
String attributeName,
String anchorValue)
styleName - the name of the stylegroupName - the name of the groupattributeName - the name of the attributeanchorValue - the actual value, e.g. "top | left"
public boolean isAlphaColor(String color)
color - the color as a hexadecimal value
public void print(Map attributes)
attributes - the attributes that should be printed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||