本文整理汇总了Java中org.w3c.css.sac.LexicalUnit.getLexicalUnitType方法的典型用法代码示例。如果您正苦于以下问题:Java LexicalUnit.getLexicalUnitType方法的具体用法?Java LexicalUnit.getLexicalUnitType怎么用?Java LexicalUnit.getLexicalUnitType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.w3c.css.sac.LexicalUnit
的用法示例。
在下文中一共展示了LexicalUnit.getLexicalUnitType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createValue
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
/**
* Implements {@link ValueManager#createValue(LexicalUnit,CSSEngine)}.
*/
public Value createValue(LexicalUnit lu, CSSEngine engine)
throws DOMException {
switch (lu.getLexicalUnitType()) {
case LexicalUnit.SAC_INHERIT:
return SVG12ValueConstants.INHERIT_VALUE;
case LexicalUnit.SAC_IDENT: {
String s = lu.getStringValue().toLowerCase();
if (SVG12CSSConstants.CSS_NORMAL_VALUE.equals(s))
return SVG12ValueConstants.NORMAL_VALUE;
throw createInvalidIdentifierDOMException(lu.getStringValue());
}
default:
return super.createValue(lu, engine);
}
}
示例2: createValue
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
/**
* Implements {@link ValueManager#createValue(LexicalUnit,CSSEngine)}.
*/
public Value createValue(LexicalUnit lu, CSSEngine engine)
throws DOMException {
switch (lu.getLexicalUnitType()) {
case LexicalUnit.SAC_INHERIT:
return ValueConstants.INHERIT_VALUE;
case LexicalUnit.SAC_IDENT:
String s = lu.getStringValue().toLowerCase().intern();
Object v = getIdentifiers().get(s);
if (v == null) {
throw createInvalidIdentifierDOMException(lu.getStringValue());
}
return (Value)v;
default:
throw createInvalidLexicalUnitDOMException
(lu.getLexicalUnitType());
}
}
示例3: createValue
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
/**
* Implements {@link ValueManager#createValue(LexicalUnit,CSSEngine)}.
*/
public Value createValue(LexicalUnit lu, CSSEngine engine)
throws DOMException {
switch (lu.getLexicalUnitType()) {
case LexicalUnit.SAC_INHERIT:
return SVGValueConstants.INHERIT_VALUE;
case LexicalUnit.SAC_IDENT:
if (lu.getStringValue().equalsIgnoreCase
(CSSConstants.CSS_AUTO_VALUE)) {
return SVGValueConstants.AUTO_VALUE;
}
throw createInvalidIdentifierDOMException(lu.getStringValue());
}
return super.createValue(lu, engine);
}
示例4: createValue
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
/**
* Implements {@link ValueManager#createValue(LexicalUnit,CSSEngine)}.
*/
public Value createValue(LexicalUnit lu, CSSEngine engine)
throws DOMException {
switch (lu.getLexicalUnitType()) {
case LexicalUnit.SAC_INHERIT:
return SVGValueConstants.INHERIT_VALUE;
case LexicalUnit.SAC_IDENT:
Object v = values.get(lu.getStringValue().toLowerCase().intern());
if (v == null) {
throw createInvalidIdentifierDOMException(lu.getStringValue());
}
return (Value)v;
}
return super.createValue(lu, engine);
}
示例5: createValue
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
/**
* Implements {@link ValueManager#createValue(LexicalUnit,CSSEngine)}.
*/
public Value createValue(LexicalUnit lu, CSSEngine engine)
throws DOMException {
switch (lu.getLexicalUnitType()) {
case LexicalUnit.SAC_INHERIT:
return SVGValueConstants.INHERIT_VALUE;
case LexicalUnit.SAC_INTEGER:
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
lu.getIntegerValue());
case LexicalUnit.SAC_REAL:
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
lu.getFloatValue());
default:
throw createInvalidLexicalUnitDOMException
(lu.getLexicalUnitType());
}
}
示例6: createValue
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
/**
* Implements {@link ValueManager#createValue(LexicalUnit,CSSEngine)}.
*/
public Value createValue(LexicalUnit lu, CSSEngine engine)
throws DOMException {
switch (lu.getLexicalUnitType()) {
case LexicalUnit.SAC_INHERIT:
return ValueConstants.INHERIT_VALUE;
case LexicalUnit.SAC_URI:
return new URIValue(lu.getStringValue(),
resolveURI(engine.getCSSBaseURI(),
lu.getStringValue()));
case LexicalUnit.SAC_IDENT:
if (lu.getStringValue().equalsIgnoreCase
(CSSConstants.CSS_NONE_VALUE)) {
return ValueConstants.NONE_VALUE;
}
}
throw createInvalidLexicalUnitDOMException(lu.getLexicalUnitType());
}
示例7: createValue
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
/**
* Implements {@link ValueManager#createValue(LexicalUnit,CSSEngine)}.
*/
public Value createValue(LexicalUnit lu, CSSEngine engine)
throws DOMException {
switch (lu.getLexicalUnitType()) {
case LexicalUnit.SAC_INHERIT:
return SVGValueConstants.INHERIT_VALUE;
case LexicalUnit.SAC_INTEGER:
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
lu.getIntegerValue());
case LexicalUnit.SAC_REAL:
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
lu.getFloatValue());
}
throw createInvalidLexicalUnitDOMException(lu.getLexicalUnitType());
}
示例8: createValue
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
/**
* Implements {@link ValueManager#createValue(LexicalUnit,CSSEngine)}.
*/
public Value createValue(LexicalUnit lu, CSSEngine engine)
throws DOMException {
switch (lu.getLexicalUnitType()) {
case LexicalUnit.SAC_INHERIT:
return SVGValueConstants.INHERIT_VALUE;
default:
throw createInvalidLexicalUnitDOMException
(lu.getLexicalUnitType());
case LexicalUnit.SAC_IDENT:
String id = lu.getStringValue().toLowerCase().intern();
if (id == CSSConstants.CSS_ACCUMULATE_VALUE) {
return SVGValueConstants.ACCUMULATE_VALUE;
}
if (id != CSSConstants.CSS_NEW_VALUE) {
throw createInvalidIdentifierDOMException(id);
}
ListValue result = new ListValue(' ');
result.append(SVGValueConstants.NEW_VALUE);
lu = lu.getNextLexicalUnit();
if (lu == null) {
return result;
}
result.append(super.createValue(lu, engine));
for (int i = 1; i < 4; i++) {
lu = lu.getNextLexicalUnit();
if (lu == null){
throw createMalformedLexicalUnitDOMException();
}
result.append(super.createValue(lu, engine));
}
return result;
}
}
示例9: createValue
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
/**
* Implements {@link ValueManager#createValue(LexicalUnit,CSSEngine)}.
*/
public Value createValue(LexicalUnit lu, CSSEngine engine)
throws DOMException {
if (lu.getLexicalUnitType() == LexicalUnit.SAC_INHERIT) {
return SVGValueConstants.INHERIT_VALUE;
}
return super.createValue(lu, engine);
}
示例10: createValue
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
/**
* Implements {@link ValueManager#createValue(LexicalUnit,CSSEngine)}.
*/
public Value createValue(LexicalUnit lu, CSSEngine engine)
throws DOMException {
if (lu.getLexicalUnitType() == LexicalUnit.SAC_IDENT) {
if (lu.getStringValue().equalsIgnoreCase
(CSSConstants.CSS_CURRENTCOLOR_VALUE)) {
return SVGValueConstants.CURRENTCOLOR_VALUE;
}
}
Value v = super.createValue(lu, engine);
lu = lu.getNextLexicalUnit();
if (lu == null) {
return v;
}
//If we have more content here, there is a color function after the sRGB color.
if (lu.getLexicalUnitType() != LexicalUnit.SAC_FUNCTION) {
throw createInvalidLexicalUnitDOMException
(lu.getLexicalUnitType());
}
ListValue result = new ListValue(' ');
result.append(v);
Value colorValue = parseColorFunction(lu, v);
if (colorValue != null) {
result.append(colorValue);
} else {
return v; //use sRGB fallback if an unsupported color function is encountered
}
return result;
}
示例11: setValues
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
/**
* Implements {@link ShorthandManager#setValues(CSSEngine,ShorthandManager.PropertyHandler,LexicalUnit,boolean)}.
*/
public void setValues(CSSEngine eng,
ShorthandManager.PropertyHandler ph,
LexicalUnit lu,
boolean imp)
throws DOMException {
if (lu.getLexicalUnitType() == LexicalUnit.SAC_INHERIT)
return;
LexicalUnit []lus = new LexicalUnit[4];
int cnt=0;
while (lu != null) {
if (cnt == 4)
throw createInvalidLexicalUnitDOMException
(lu.getLexicalUnitType());
lus[cnt++] = lu;
lu = lu.getNextLexicalUnit();
}
switch (cnt) {
case 1: lus[3] = lus[2] = lus[1] = lus[0]; break;
case 2: lus[2] = lus[0]; lus[3] = lus[1]; break;
case 3: lus[3] = lus[1]; break;
default:
}
ph.property(SVG12CSSConstants.CSS_MARGIN_TOP_PROPERTY, lus[0], imp);
ph.property(SVG12CSSConstants.CSS_MARGIN_RIGHT_PROPERTY, lus[1], imp);
ph.property(SVG12CSSConstants.CSS_MARGIN_BOTTOM_PROPERTY, lus[2], imp);
ph.property(SVG12CSSConstants.CSS_MARGIN_LEFT_PROPERTY, lus[3], imp);
}
示例12: createValue
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
/**
* Implements {@link ValueManager#createValue(LexicalUnit,CSSEngine)}.
*/
public Value createValue(LexicalUnit lu, CSSEngine engine)
throws DOMException {
if (lu.getLexicalUnitType() == LexicalUnit.SAC_IDENT) {
if (lu.getStringValue().equalsIgnoreCase
(CSSConstants.CSS_AUTO_VALUE)) {
return SVGValueConstants.AUTO_VALUE;
}
throw createInvalidIdentifierDOMException(lu.getStringValue());
}
return super.createValue(lu, engine);
}
示例13: createValue
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
/**
* Implements {@link ValueManager#createValue(LexicalUnit,CSSEngine)}.
*/
public Value createValue(LexicalUnit lu, CSSEngine engine)
throws DOMException {
switch (lu.getLexicalUnitType()) {
case LexicalUnit.SAC_INHERIT:
return ValueConstants.INHERIT_VALUE;
case LexicalUnit.SAC_IDENT:
if (lu.getStringValue().equalsIgnoreCase
(CSSConstants.CSS_NONE_VALUE)) {
return ValueConstants.NONE_VALUE;
}
ListValue lv = new ListValue(' ');
do {
if (lu.getLexicalUnitType() == LexicalUnit.SAC_IDENT) {
String s = lu.getStringValue().toLowerCase().intern();
Object obj = values.get(s);
if (obj == null) {
throw createInvalidIdentifierDOMException
(lu.getStringValue());
}
lv.append((Value)obj);
lu = lu.getNextLexicalUnit();
} else {
throw createInvalidLexicalUnitDOMException
(lu.getLexicalUnitType());
}
} while (lu != null);
return lv;
}
throw createInvalidLexicalUnitDOMException
(lu.getLexicalUnitType());
}
示例14: createRectComponent
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
private Value createRectComponent(LexicalUnit lu) throws DOMException {
switch (lu.getLexicalUnitType()) {
case LexicalUnit.SAC_IDENT:
if (lu.getStringValue().equalsIgnoreCase
(CSSConstants.CSS_AUTO_VALUE)) {
return ValueConstants.AUTO_VALUE;
}
break;
case LexicalUnit.SAC_EM:
return new FloatValue(CSSPrimitiveValue.CSS_EMS,
lu.getFloatValue());
case LexicalUnit.SAC_EX:
return new FloatValue(CSSPrimitiveValue.CSS_EXS,
lu.getFloatValue());
case LexicalUnit.SAC_PIXEL:
return new FloatValue(CSSPrimitiveValue.CSS_PX,
lu.getFloatValue());
case LexicalUnit.SAC_CENTIMETER:
return new FloatValue(CSSPrimitiveValue.CSS_CM,
lu.getFloatValue());
case LexicalUnit.SAC_MILLIMETER:
return new FloatValue(CSSPrimitiveValue.CSS_MM,
lu.getFloatValue());
case LexicalUnit.SAC_INCH:
return new FloatValue(CSSPrimitiveValue.CSS_IN,
lu.getFloatValue());
case LexicalUnit.SAC_POINT:
return new FloatValue(CSSPrimitiveValue.CSS_PT,
lu.getFloatValue());
case LexicalUnit.SAC_PICA:
return new FloatValue(CSSPrimitiveValue.CSS_PC,
lu.getFloatValue());
case LexicalUnit.SAC_INTEGER:
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
lu.getIntegerValue());
case LexicalUnit.SAC_REAL:
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
lu.getFloatValue());
case LexicalUnit.SAC_PERCENTAGE:
return new FloatValue(CSSPrimitiveValue.CSS_PERCENTAGE,
lu.getFloatValue());
}
throw createMalformedRectDOMException();
}
示例15: createValue
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
/**
* Implements {@link ValueManager#createValue(LexicalUnit,CSSEngine)}.
*/
public Value createValue(LexicalUnit lu, CSSEngine engine)
throws DOMException {
switch (lu.getLexicalUnitType()) {
case LexicalUnit.SAC_EM:
return new FloatValue(CSSPrimitiveValue.CSS_EMS,
lu.getFloatValue());
case LexicalUnit.SAC_EX:
return new FloatValue(CSSPrimitiveValue.CSS_EXS,
lu.getFloatValue());
case LexicalUnit.SAC_PIXEL:
return new FloatValue(CSSPrimitiveValue.CSS_PX,
lu.getFloatValue());
case LexicalUnit.SAC_CENTIMETER:
return new FloatValue(CSSPrimitiveValue.CSS_CM,
lu.getFloatValue());
case LexicalUnit.SAC_MILLIMETER:
return new FloatValue(CSSPrimitiveValue.CSS_MM,
lu.getFloatValue());
case LexicalUnit.SAC_INCH:
return new FloatValue(CSSPrimitiveValue.CSS_IN,
lu.getFloatValue());
case LexicalUnit.SAC_POINT:
return new FloatValue(CSSPrimitiveValue.CSS_PT,
lu.getFloatValue());
case LexicalUnit.SAC_PICA:
return new FloatValue(CSSPrimitiveValue.CSS_PC,
lu.getFloatValue());
case LexicalUnit.SAC_INTEGER:
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
lu.getIntegerValue());
case LexicalUnit.SAC_REAL:
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
lu.getFloatValue());
case LexicalUnit.SAC_PERCENTAGE:
return new FloatValue(CSSPrimitiveValue.CSS_PERCENTAGE,
lu.getFloatValue());
}
throw createInvalidLexicalUnitDOMException(lu.getLexicalUnitType());
}