public Object get(Object key) { return get(String.valueOf(key)); }
Object velocityContext = values.get("velocityContext");
Object velocityContext = values.get("velocityContext");
/** * {@inheritDoc} * * @see SafeConfig#configure(ValueParser) */ @Override protected void configure(ValueParser values) { // retrieve the Velocity context for output encoding Object velocityContext = values.get("velocityContext"); if (!(velocityContext instanceof ToolContext)) { return; } ToolContext ctxt = (ToolContext) velocityContext; // get the output encoding Object outputEncodingObj = ctxt.get("outputEncoding"); if (outputEncodingObj instanceof String) { this.outputEncoding = (String) outputEncodingObj; } }
/** * {@inheritDoc} * * @see SafeConfig#configure(ValueParser) */ @Override protected void configure(ValueParser values) { // retrieve the Velocity context for output encoding Object velocityContext = values.get("velocityContext"); if (!(velocityContext instanceof ToolContext)) { return; } ToolContext ctxt = (ToolContext) velocityContext; // get the output encoding Object outputEncodingObj = ctxt.get("outputEncoding"); if (outputEncodingObj instanceof String) { this.outputEncoding = (String) outputEncodingObj; } }
/** * Sets up the tool with the skin configuration and file id. */ @Override protected final void configure(final ValueParser values) { final Object velocityContext; // Value from the parser final ToolContext ctxt; // Casted context final Object decorationObj; // Value of the decoration key checkNotNull(values, "Received a null pointer as values"); velocityContext = values.get(ConfigToolConstants.VELOCITY_CONTEXT_KEY); if (velocityContext instanceof ToolContext) { ctxt = (ToolContext) velocityContext; loadFileId(ctxt); decorationObj = ctxt.get(ConfigToolConstants.DECORATION_KEY); if (decorationObj instanceof DecorationModel) { processDecoration((DecorationModel) decorationObj); } } }