public class DeclarationTransformer extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
camelCase(String string)
Converts string divided by dash ('-') characters into camelCase such as
convenient for Java method names
|
protected <T extends CSSProperty> |
genericOneIdent(Class<T> type,
Declaration d,
Map<String,CSSProperty> properties)
Processes declaration which is supposed to contain one identification
term
|
protected <T extends CSSProperty> |
genericOneIdentOrColor(Class<T> type,
T colorIdentification,
Declaration d,
Map<String,CSSProperty> properties,
Map<String,Term<?>> values)
Processes declaration which is supposed to contain one identification
term or one TermColor
|
protected <T extends CSSProperty> |
genericOneIdentOrInteger(Class<T> type,
T integerIdentification,
boolean sanify,
Declaration d,
Map<String,CSSProperty> properties,
Map<String,Term<?>> values) |
protected <T extends CSSProperty> |
genericOneIdentOrIntegerOrNumber(Class<T> type,
T integerIdentification,
T numberIdentification,
boolean sanify,
Declaration d,
Map<String,CSSProperty> properties,
Map<String,Term<?>> values) |
protected <T extends CSSProperty> |
genericOneIdentOrLength(Class<T> type,
T lengthIdentification,
boolean sanify,
Declaration d,
Map<String,CSSProperty> properties,
Map<String,Term<?>> values) |
protected <T extends Enum<T> & CSSProperty> |
genericOneIdentOrLengthOrPercent(Class<T> type,
T lengthIdentification,
T percentIdentification,
boolean sanify,
Declaration d,
Map<String,CSSProperty> properties,
Map<String,Term<?>> values) |
protected <T extends CSSProperty> |
genericProperty(Class<T> type,
TermIdent term,
boolean avoidInherit,
Map<String,CSSProperty> properties,
String propertyName)
Converts TermIdent into value of enum of given class and stores it into
properties map under key property
|
<T extends CSSProperty> |
genericPropertyRaw(Class<T> type,
Set<T> intersection,
TermIdent term)
Converts TermIdent into CSSProperty using intersection set.
|
protected <T extends CSSProperty> |
genericTerm(Class<? extends Term<?>> termType,
Term<?> term,
String propertyName,
T typeIdentification,
boolean sanify,
Map<String,CSSProperty> properties,
Map<String,Term<?>> values)
Check whether given declaration contains one term of given type.
|
protected <T extends CSSProperty> |
genericTermColor(Term<?> term,
String propertyName,
T colorIdentification,
Map<String,CSSProperty> properties,
Map<String,Term<?>> values)
Converts term into Color and stored values and types in maps
|
protected <T extends CSSProperty> |
genericTermIdent(Class<T> type,
Term<?> term,
boolean avoidInherit,
String propertyName,
Map<String,CSSProperty> properties)
Converts TermIdent into value of CSSProperty for given class
|
protected <T extends CSSProperty> |
genericTermLength(Term<?> term,
String propertyName,
T lengthIdentification,
boolean sanify,
Map<String,CSSProperty> properties,
Map<String,Term<?>> values)
Converts term into TermLength and stores values and types in maps
|
protected <T extends Enum<T> & CSSProperty> |
genericTwoIdentsOrLengthsOrPercents(Class<T> type,
T listIdentification,
boolean sanify,
Declaration d,
Map<String,CSSProperty> properties,
Map<String,Term<?>> values) |
static DeclarationTransformer |
getInstance()
Returns instance
|
boolean |
parseDeclaration(Declaration d,
Map<String,CSSProperty> properties,
Map<String,Term<?>> values)
Core function.
|
protected Map<String,Method> |
parsingMethods() |
public static final DeclarationTransformer getInstance()
public static final String camelCase(String string)
string - String to convertpublic boolean parseDeclaration(Declaration d, Map<String,CSSProperty> properties, Map<String,Term<?>> values)
d - Declarationproperties - Wrap of parsed declaration's propertiesvalues - Wrap of parsed declaration's valuetrue in case of success, false
otherwisepublic <T extends CSSProperty> T genericPropertyRaw(Class<T> type, Set<T> intersection, TermIdent term)
T - Subclass of CSSProperty to be returnedtype - Class of property to be used to retrive valueintersection - Intersection set or null if no intersection is
usedterm - TermIdent to be transfered to propertynullprotected <T extends CSSProperty> boolean genericProperty(Class<T> type, TermIdent term, boolean avoidInherit, Map<String,CSSProperty> properties, String propertyName)
T - Enum & CSSProperty limitationenumType - Type of enum which instance is retrievedterm - Term with value to be convertedavoidInherit - If true inherit value is not considered validproperties - Properties map where to store valuepropertyName - Name under which property is stored in maptrue in case of success, false
otherwiseprotected <T extends CSSProperty> boolean genericTermIdent(Class<T> type, Term<?> term, boolean avoidInherit, String propertyName, Map<String,CSSProperty> properties)
protected <T extends CSSProperty> boolean genericTermColor(Term<?> term, String propertyName, T colorIdentification, Map<String,CSSProperty> properties, Map<String,Term<?>> values)
T - CSSPropertyterm - Term to be parsedpropertyName - How to store colorIdentificitoncolorIdentification - What to store under propertyNameproperties - Map to store property typesvalues - Map to store property valuestrue in case of success, false
otherwiseprotected <T extends CSSProperty> boolean genericTermLength(Term<?> term, String propertyName, T lengthIdentification, boolean sanify, Map<String,CSSProperty> properties, Map<String,Term<?>> values)
T - CSSPropertyterm - Term to be parsedpropertyName - How to store colorIdentificitonlengthIdentification - What to store under propertyNameproperties - Map to store property typesvalues - Map to store property valuestrue in case of success, false
otherwiseprotected <T extends CSSProperty> boolean genericTerm(Class<? extends Term<?>> termType, Term<?> term, String propertyName, T typeIdentification, boolean sanify, Map<String,CSSProperty> properties, Map<String,Term<?>> values)
T - Class of CSSProperty to be used for resulttermType - Supposed type of termterm - Term of which is supposed to be of type termType,
that is input datapropertyName - Name under which property's value and type is stored in mapstypeIdentification - How this type of term is described in type Tsanify - Check if value is positiveproperties - Where to store property typevalues - Where to store property valuetrue if succeeded in recognition, false
otherwiseprotected <T extends CSSProperty> boolean genericOneIdent(Class<T> type, Declaration d, Map<String,CSSProperty> properties)
T - Type of CSSPropertytype - Class of CSSProperty to be storedd - Declaration to be parsedproperties - Properties map where to store enumtrue in case of success, false
elsewhereprotected <T extends CSSProperty> boolean genericOneIdentOrColor(Class<T> type, T colorIdentification, Declaration d, Map<String,CSSProperty> properties, Map<String,Term<?>> values)
T - Type of CSSPropertytype - Class of enum to be storedcolorIdentification - Instance of CSSProperty stored into properties to indicate
that additional value of type TermColor is stored in valuesd - Declaration to be parsedproperties - Properties map where to store enumvalues - true in case of success, false
elsewhereprotected <T extends CSSProperty> boolean genericOneIdentOrInteger(Class<T> type, T integerIdentification, boolean sanify, Declaration d, Map<String,CSSProperty> properties, Map<String,Term<?>> values)
protected <T extends CSSProperty> boolean genericOneIdentOrIntegerOrNumber(Class<T> type, T integerIdentification, T numberIdentification, boolean sanify, Declaration d, Map<String,CSSProperty> properties, Map<String,Term<?>> values)
protected <T extends CSSProperty> boolean genericOneIdentOrLength(Class<T> type, T lengthIdentification, boolean sanify, Declaration d, Map<String,CSSProperty> properties, Map<String,Term<?>> values)
protected <T extends Enum<T> & CSSProperty> boolean genericOneIdentOrLengthOrPercent(Class<T> type, T lengthIdentification, T percentIdentification, boolean sanify, Declaration d, Map<String,CSSProperty> properties, Map<String,Term<?>> values)
protected <T extends Enum<T> & CSSProperty> boolean genericTwoIdentsOrLengthsOrPercents(Class<T> type, T listIdentification, boolean sanify, Declaration d, Map<String,CSSProperty> properties, Map<String,Term<?>> values)
Copyright © 2014. All rights reserved.