コード例 #1
0
 /** Implements {@link ValueManager#createStringValue(short,String,CSSEngine)}. */
 public Value createStringValue(short type, String value, CSSEngine engine) throws DOMException {
   if (type != CSSPrimitiveValue.CSS_IDENT) {
     throw createInvalidIdentifierDOMException(value);
   }
   Object v = values.get(value.toLowerCase().intern());
   if (v == null) {
     throw createInvalidIdentifierDOMException(value);
   }
   return (Value) v;
 }
コード例 #2
0
  /** 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);
  }