java.lang.Object
org.htmlunit.cssparser.parser.AbstractLocatable
org.htmlunit.cssparser.parser.LexicalUnitImpl
- All Implemented Interfaces:
Serializable,LexicalUnit,Locatable
Implementation of
LexicalUnit.- Author:
- Ronald Brill
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.htmlunit.cssparser.parser.LexicalUnit
LexicalUnit.LexicalUnitType -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLexicalUnitImpl(LexicalUnit previous, int value) Constructs a new integer LexicalUnitImpl.LexicalUnitImpl(LexicalUnit previous, LexicalUnit.LexicalUnitType type) Constructs a new LexicalUnitImpl.protectedLexicalUnitImpl(LexicalUnit previous, LexicalUnit.LexicalUnitType type, double value) Constructs a new dimension LexicalUnitImpl.LexicalUnitImpl(LexicalUnit previous, LexicalUnit.LexicalUnitType type, String value) Constructs a new string LexicalUnitImpl.protectedLexicalUnitImpl(LexicalUnit previous, LexicalUnit.LexicalUnitType type, String dimension, double value) Constructs a new unknown dimension LexicalUnitImpl.protectedLexicalUnitImpl(LexicalUnit previous, LexicalUnit.LexicalUnitType type, String name, String stringValue) Constructs a new function LexicalUnitImpl.protectedLexicalUnitImpl(LexicalUnit previous, LexicalUnit.LexicalUnitType type, String name, LexicalUnit params) Constructs a new function LexicalUnitImpl. -
Method Summary
Modifier and TypeMethodDescriptionstatic LexicalUnitcreateAttr(LexicalUnit prev, String value) Creates a lexical unit with type attr.static LexicalUnitcreateCalc(LexicalUnit prev, LexicalUnit params) Creates a lexical unit with type calc function.static LexicalUnitcreateCentimeter(LexicalUnit prev, double d) Creates a lexical unit with type centimeter.static LexicalUnitcreateCh(LexicalUnit prev, double d) Creates a lexical unit with type ch.static LexicalUnitcreateComma(LexicalUnit prev) Creates a lexical unit with type comma.static LexicalUnitcreateCounter(LexicalUnit prev, LexicalUnit params) Creates a lexical unit with type counter function.static LexicalUnitcreateCounters(LexicalUnit prev, LexicalUnit params) Creates a lexical unit with type counters function.static LexicalUnitcreateDegree(LexicalUnit prev, double d) Creates a lexical unit with type degree.static LexicalUnitcreateDimension(LexicalUnit prev, double d, String dim) Creates a lexical unit with type dimension.static LexicalUnitcreateDivide(LexicalUnit prev) Creates a lexical unit with type divide.static LexicalUnitcreateDvh(LexicalUnit prev, double d) Creates a lexical unit with type dvh.static LexicalUnitcreateDvMax(LexicalUnit prev, double d) Creates a lexical unit with type dvmax.static LexicalUnitcreateDvMin(LexicalUnit prev, double d) Creates a lexical unit with type dvmin.static LexicalUnitcreateDvw(LexicalUnit prev, double d) Creates a lexical unit with type dvw.static LexicalUnitcreateEm(LexicalUnit prev, double d) Creates a lexical unit with type em.static LexicalUnitcreateEx(LexicalUnit prev, double d) Creates a lexical unit with type ex.static LexicalUnitcreateFrom(LexicalUnit prev) Creates a lexical unit with type from.static LexicalUnitcreateFunction(LexicalUnit prev, String name, LexicalUnit params) Creates a lexical unit with type function.static LexicalUnitcreateGradian(LexicalUnit prev, double d) Creates a lexical unit with type gradian.static LexicalUnitcreateHertz(LexicalUnit prev, double d) Creates a lexical unit with type hertz.static LexicalUnitcreateHslColor(LexicalUnit prev, String funct, LexicalUnit params) Creates a lexical unit with type hsl color.static LexicalUnitcreateHwbColor(LexicalUnit prev, String funct, LexicalUnit params) Creates a lexical unit with type hwb color.static LexicalUnitcreateIdent(LexicalUnit prev, String value) Creates a lexical unit with type ident.static LexicalUnitcreateInch(LexicalUnit prev, double d) Creates a lexical unit with type inch.static LexicalUnitcreateInherit(LexicalUnit prev) Creates a lexical unit with type inherit.static LexicalUnitcreateKiloHertz(LexicalUnit prev, double d) Creates a lexical unit with type kilohertz.static LexicalUnitcreateLabColor(LexicalUnit prev, String funct, LexicalUnit params) Creates a lexical unit with type lab color.static LexicalUnitcreateLchColor(LexicalUnit prev, String funct, LexicalUnit params) Creates a lexical unit with type lch color.static LexicalUnitcreateLvh(LexicalUnit prev, double d) Creates a lexical unit with type lvh.static LexicalUnitcreateLvMax(LexicalUnit prev, double d) Creates a lexical unit with type lvmax.static LexicalUnitcreateLvMin(LexicalUnit prev, double d) Creates a lexical unit with type lvmin.static LexicalUnitcreateLvw(LexicalUnit prev, double d) Creates a lexical unit with type lvw.static LexicalUnitcreateMillimeter(LexicalUnit prev, double d) Creates a lexical unit with type millimeter.static LexicalUnitcreateMillisecond(LexicalUnit prev, double d) Creates a lexical unit with type millisecond.static LexicalUnitcreateMinus(LexicalUnit prev) Creates a lexical unit with type minus.static LexicalUnitcreateMultiply(LexicalUnit prev) Creates a lexical unit with type multiply.static LexicalUnitcreateNone(LexicalUnit prev) Creates a lexical unit with type none.static LexicalUnitcreateNumber(LexicalUnit prev, double d) Creates a lexical unit with type real.static LexicalUnitcreateNumber(LexicalUnit prev, int i) Creates a lexical unit with type integer.static LexicalUnitcreatePercentage(LexicalUnit prev, double d) Creates a lexical unit with type percentage.static LexicalUnitcreatePica(LexicalUnit prev, double d) Creates a lexical unit with type pica.static LexicalUnitcreatePixel(LexicalUnit prev, double d) Creates a lexical unit with type pixel.static LexicalUnitcreatePlus(LexicalUnit prev) Creates a lexical unit with type plus.static LexicalUnitcreatePoint(LexicalUnit prev, double d) Creates a lexical unit with type point.static LexicalUnitcreateQuarter(LexicalUnit prev, double d) Creates a lexical unit with type quarter.static LexicalUnitcreateRadian(LexicalUnit prev, double d) Creates a lexical unit with type radian.static LexicalUnitcreateRect(LexicalUnit prev, LexicalUnit params) Creates a lexical unit with type rect function.static LexicalUnitcreateRem(LexicalUnit prev, double d) Creates a lexical unit with type rem.static LexicalUnitcreateRgbColor(LexicalUnit prev, String funct, LexicalUnit params) Creates a lexical unit with type rgb color.static LexicalUnitcreateSecond(LexicalUnit prev, double d) Creates a lexical unit with type second.static LexicalUnitcreateSlash(LexicalUnit prev) Creates a lexical unit with type slash.static LexicalUnitcreateString(LexicalUnit prev, String value) Creates a lexical unit with type string.static LexicalUnitcreateSvh(LexicalUnit prev, double d) Creates a lexical unit with type svh.static LexicalUnitcreateSvMax(LexicalUnit prev, double d) Creates a lexical unit with type svmax.static LexicalUnitcreateSvMin(LexicalUnit prev, double d) Creates a lexical unit with type svmin.static LexicalUnitcreateSvw(LexicalUnit prev, double d) Creates a lexical unit with type svw.static LexicalUnitcreateTurn(LexicalUnit prev, double d) Creates a lexical unit with type turn.static LexicalUnitcreateURI(LexicalUnit prev, String value) Creates a lexical unit with type uri.static LexicalUnitcreateVh(LexicalUnit prev, double d) Creates a lexical unit with type vh.static LexicalUnitcreateVMax(LexicalUnit prev, double d) Creates a lexical unit with type vmax.static LexicalUnitcreateVMin(LexicalUnit prev, double d) Creates a lexical unit with type vmin.static LexicalUnitcreateVw(LexicalUnit prev, double d) Creates a lexical unit with type vw.Returns the current CSS text.Returns the dimension.getDimensionUnitText.doublegetDoubleValue.getFunctionName.intgetIntegerValue.getLexicalUnitType.getNextLexicalUnit.getParameters.getPreviousLexicalUnit.getStringValue.getSubValues.voidsetDimension(String dimension) Sets the dimension.voidsetDoubleValue(double doubleVal) Sets the double value.voidsetFunctionName(String function) Sets the function name.voidSets the next lexical unit.voidsetParameters(LexicalUnit params) Sets the parameter lexical unit.voidSets the previous lexical unit.voidsetStringValue(String stringVal) Sets the string value.Returns a string representation to help with debugging.toString()Methods inherited from class org.htmlunit.cssparser.parser.AbstractLocatable
getLocator, setLocatorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.htmlunit.cssparser.parser.LexicalUnit
getLocator, setLocator
-
Constructor Details
-
LexicalUnitImpl
Constructs a new LexicalUnitImpl.- Parameters:
previous- the previous LexicalUnittype- the LexicalUnitType
-
LexicalUnitImpl
Constructs a new integer LexicalUnitImpl.- Parameters:
previous- the previous LexicalUnitvalue- the int value
-
LexicalUnitImpl
Constructs a new dimension LexicalUnitImpl.- Parameters:
previous- the previous LexicalUnittype- the LexicalUnitTypevalue- the double value
-
LexicalUnitImpl
protected LexicalUnitImpl(LexicalUnit previous, LexicalUnit.LexicalUnitType type, String dimension, double value) Constructs a new unknown dimension LexicalUnitImpl.- Parameters:
previous- the previous LexicalUnittype- the LexicalUnitTypedimension- the dimensionvalue- the double value
-
LexicalUnitImpl
Constructs a new string LexicalUnitImpl.- Parameters:
previous- the previous LexicalUnittype- the LexicalUnitTypevalue- the string value
-
LexicalUnitImpl
protected LexicalUnitImpl(LexicalUnit previous, LexicalUnit.LexicalUnitType type, String name, LexicalUnit params) Constructs a new function LexicalUnitImpl.- Parameters:
previous- the previous LexicalUnittype- the LexicalUnitTypename- the nameparams- the parameter LexicalUnit
-
LexicalUnitImpl
protected LexicalUnitImpl(LexicalUnit previous, LexicalUnit.LexicalUnitType type, String name, String stringValue) Constructs a new function LexicalUnitImpl.- Parameters:
previous- the previous LexicalUnittype- the LexicalUnitTypename- the namestringValue- the string value
-
-
Method Details
-
setNextLexicalUnit
Sets the next lexical unit.- Parameters:
next- next LexicalUnit
-
setPreviousLexicalUnit
Sets the previous lexical unit.- Parameters:
prev- previous LexicalUnit
-
setDoubleValue
public void setDoubleValue(double doubleVal) Sets the double value.- Parameters:
doubleVal- the double value
-
getDimension
Returns the dimension.- Returns:
- the dimension
-
setDimension
Sets the dimension.- Parameters:
dimension- the new dimension
-
setFunctionName
Sets the function name.- Parameters:
function- the function name
-
setParameters
Sets the parameter lexical unit.- Parameters:
params- the parameter LexicalUnit
-
setStringValue
Sets the string value.- Parameters:
stringVal- the string value
-
getLexicalUnitType
getLexicalUnitType.
- Specified by:
getLexicalUnitTypein interfaceLexicalUnit- Returns:
- an integer indicating the type of
LexicalUnit.
-
getNextLexicalUnit
getNextLexicalUnit.
- Specified by:
getNextLexicalUnitin interfaceLexicalUnit- Returns:
- the next value or
nullif any.
-
getPreviousLexicalUnit
getPreviousLexicalUnit.
- Specified by:
getPreviousLexicalUnitin interfaceLexicalUnit- Returns:
- the previous value or
nullif any.
-
getIntegerValue
public int getIntegerValue()getIntegerValue.
- Specified by:
getIntegerValuein interfaceLexicalUnit- Returns:
- the integer value.
-
getDoubleValue
public double getDoubleValue()getDoubleValue.
- Specified by:
getDoubleValuein interfaceLexicalUnit- Returns:
- the double value.
-
getDimensionUnitText
getDimensionUnitText.
- Specified by:
getDimensionUnitTextin interfaceLexicalUnit- Returns:
- the string representation of the unit.
-
getFunctionName
getFunctionName.
- Specified by:
getFunctionNamein interfaceLexicalUnit- Returns:
- the name of the function.
-
getParameters
getParameters.
- Specified by:
getParametersin interfaceLexicalUnit- Returns:
- the function parameters including operators (like the comma).
-
getStringValue
getStringValue.
- Specified by:
getStringValuein interfaceLexicalUnit- Returns:
- the string value.
-
getSubValues
getSubValues.
- Specified by:
getSubValuesin interfaceLexicalUnit- Returns:
- a list of values inside the sub expression.
-
getCssText
Returns the current CSS text.- Returns:
- the current css text
-
toString
-
toDebugString
Returns a string representation to help with debugging.- Returns:
- a string helping to debug
-
createNumber
Creates a lexical unit with type integer.- Parameters:
prev- the previous LexicalUniti- the integer value- Returns:
- lexical unit with type integer
-
createNumber
Creates a lexical unit with type real.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type real
-
createPercentage
Creates a lexical unit with type percentage.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type percent
-
createPixel
Creates a lexical unit with type pixel.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type pixel
-
createCentimeter
Creates a lexical unit with type centimeter.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type centimeter
-
createMillimeter
Creates a lexical unit with type millimeter.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type millimeter
-
createInch
Creates a lexical unit with type inch.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type inch
-
createPoint
Creates a lexical unit with type point.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type point
-
createPica
Creates a lexical unit with type pica.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type pica
-
createQuarter
Creates a lexical unit with type quarter.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type quarter
-
createEm
Creates a lexical unit with type em.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type em
-
createRem
Creates a lexical unit with type rem.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type rem
-
createEx
Creates a lexical unit with type ex.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type ex
-
createCh
Creates a lexical unit with type ch.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type ch
-
createVw
Creates a lexical unit with type vw.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type vw
-
createVh
Creates a lexical unit with type vh.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type vh
-
createVMin
Creates a lexical unit with type vmin.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type vmin
-
createVMax
Creates a lexical unit with type vmax.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type vmax
-
createDvw
Creates a lexical unit with type dvw.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type dvw
-
createDvh
Creates a lexical unit with type dvh.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type dvh
-
createDvMin
Creates a lexical unit with type dvmin.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type dvmin
-
createDvMax
Creates a lexical unit with type dvmax.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type dvmax
-
createLvw
Creates a lexical unit with type lvw.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type lvw
-
createLvh
Creates a lexical unit with type lvh.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type lvh
-
createLvMin
Creates a lexical unit with type lvmin.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type lvmin
-
createLvMax
Creates a lexical unit with type lvmax.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type lvmax
-
createSvw
Creates a lexical unit with type svw.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type svw
-
createSvh
Creates a lexical unit with type svh.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type svh
-
createSvMin
Creates a lexical unit with type svmin.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type svmin
-
createSvMax
Creates a lexical unit with type svmax.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type svmax
-
createDegree
Creates a lexical unit with type degree.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type degree
-
createRadian
Creates a lexical unit with type radian.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type radian
-
createGradian
Creates a lexical unit with type gradian.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type gradian
-
createTurn
Creates a lexical unit with type turn.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type turn
-
createMillisecond
Creates a lexical unit with type millisecond.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type millisecond
-
createSecond
Creates a lexical unit with type second.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type second
-
createHertz
Creates a lexical unit with type hertz.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type hertz
-
createDimension
Creates a lexical unit with type dimension.- Parameters:
prev- the previous LexicalUnitd- the double valuedim- the dimension- Returns:
- lexical unit with type dimension
-
createKiloHertz
Creates a lexical unit with type kilohertz.- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type kilohertz
-
createCounter
Creates a lexical unit with type counter function.- Parameters:
prev- the previous LexicalUnitparams- the params- Returns:
- lexical unit with type counter
-
createCounters
Creates a lexical unit with type counters function.- Parameters:
prev- the previous LexicalUnitparams- the params- Returns:
- lexical unit with type counters
-
createAttr
Creates a lexical unit with type attr.- Parameters:
prev- the previous LexicalUnitvalue- the value- Returns:
- lexical unit with type attr
-
createRect
Creates a lexical unit with type rect function.- Parameters:
prev- the previous LexicalUnitparams- the params- Returns:
- lexical unit with type rect
-
createRgbColor
Creates a lexical unit with type rgb color.- Parameters:
prev- the previous LexicalUnitfunct- the name rgb or rgbaparams- the params- Returns:
- lexical unit with type rgb color
-
createHslColor
Creates a lexical unit with type hsl color.- Parameters:
prev- the previous LexicalUnitfunct- the name hsl or hslaparams- the params- Returns:
- lexical unit with type hsl color
-
createHwbColor
Creates a lexical unit with type hwb color.- Parameters:
prev- the previous LexicalUnitfunct- the name hwbparams- the params- Returns:
- lexical unit with type hwb color
-
createLabColor
Creates a lexical unit with type lab color.- Parameters:
prev- the previous LexicalUnitfunct- the name labparams- the params- Returns:
- lexical unit with type lab color
-
createLchColor
Creates a lexical unit with type lch color.- Parameters:
prev- the previous LexicalUnitfunct- the name lchparams- the params- Returns:
- lexical unit with type lch color
-
createNone
Creates a lexical unit with type none.- Parameters:
prev- the previous LexicalUnit- Returns:
- lexical unit with type rgb color
-
createFrom
Creates a lexical unit with type from.- Parameters:
prev- the previous LexicalUnit- Returns:
- lexical unit with type rgb color
-
createCalc
Creates a lexical unit with type calc function.- Parameters:
prev- the previous LexicalUnitparams- the params- Returns:
- lexical unit with type calc
-
createFunction
Creates a lexical unit with type function.- Parameters:
prev- the previous LexicalUnitname- the nameparams- the params- Returns:
- lexical unit with type function
-
createString
Creates a lexical unit with type string.- Parameters:
prev- the previous LexicalUnitvalue- the value- Returns:
- lexical unit with type string
-
createIdent
Creates a lexical unit with type ident.- Parameters:
prev- the previous LexicalUnitvalue- the value- Returns:
- lexical unit with type ident
-
createURI
Creates a lexical unit with type uri.- Parameters:
prev- the previous LexicalUnitvalue- the value- Returns:
- lexical unit with type uri
-
createComma
Creates a lexical unit with type comma.- Parameters:
prev- the previous LexicalUnit- Returns:
- lexical unit with type comma
-
createInherit
Creates a lexical unit with type inherit.- Parameters:
prev- the previous LexicalUnit- Returns:
- lexical unit with type comma
-
createSlash
Creates a lexical unit with type slash.- Parameters:
prev- the previous LexicalUnit- Returns:
- lexical unit with type slash
-
createPlus
Creates a lexical unit with type plus.- Parameters:
prev- the previous LexicalUnit- Returns:
- lexical unit with type plus
-
createMinus
Creates a lexical unit with type minus.- Parameters:
prev- the previous LexicalUnit- Returns:
- lexical unit with type minus
-
createMultiply
Creates a lexical unit with type multiply.- Parameters:
prev- the previous LexicalUnit- Returns:
- lexical unit with type multiply
-
createDivide
Creates a lexical unit with type divide.- Parameters:
prev- the previous LexicalUnit- Returns:
- lexical unit with type slash
-