Override default implementation of getValue()

@param msg
@param contextValue
@throws MatchingException
@throws BadMessageFormatMatchingException
769330
Object getValue(
        MatchSpaceKey msg,
        Object contextValue)
        throws MatchingException, BadMessageFormatMatchingException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.entry(
        cclass,
        "getValue",
        "msg: " + msg + "contextValue: " + contextValue);
    
    // The value which we'll return    
    SetValEvaluationContext xpEval = null;    

    // May need to call MFP multiple times, if our context has multiple nodes
    if(contextValue != null)
    {
      // Currently this must be a list of nodes
      if (contextValue instanceof SetValEvaluationContext)
      {
        SetValEvaluationContext evalContext = (SetValEvaluationContext)contextValue;

        // Get the node list
        ArrayList wrappedParentList = evalContext.getWrappedNodeList();
        
        // If the list is empty, then we have yet to get the document root
        if(wrappedParentList.isEmpty())
        {
    	    //Set up a root (document) context for evaluation
          Object docRoot = Matching.getEvaluator().getDocumentRoot(msg);
            
          // Create an object to hold the wrapped node
          WrappedNodeResults wrapper = new WrappedNodeResults(docRoot);
          // Set the root into the evaluation context
          evalContext.addNode(wrapper);
        }
        
        // Iterate over the nodes
        Iterator iter = wrappedParentList.iterator();

        while(iter.hasNext())
        {
          WrappedNodeResults nextWrappedNode = (WrappedNodeResults)iter.next();       
          Object nextParentNode = nextWrappedNode.getNode();
          
          String debugString = "";
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            tc.debug(this,cclass, "getValue", "Evaluation context node: " + nextWrappedNode);  
          
          // If no cached value we'll need to call MFP
          ArrayList stringList = nextWrappedNode.getEvalStringResult(id.getName());
            
          if(stringList == null)
          {
            // Call MFP to get the results for this node
            ArrayList childNodeList = 
              (ArrayList) msg.getIdentifierValue(id,
                                                 false,
                                                 nextParentNode, 
                                                 true); // true means return a nodelist
            
            // Process the retrieved nodes to get a list of Integers
            stringList = Matching.getEvaluator().castToStringList(childNodeList);
            
            // Add result to cache for next time
            nextWrappedNode.addEvalStringResult(id.getName(), stringList);
            
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
              debugString = "Result from MFP ";
          }
          else
          {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
              debugString = "Result from Cache ";
          }
          
          // Useful debug
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
          {
            String asString = ", type: String - <";
            if(stringList == null)
            {
              asString = asString + "null";
            }
            else
            {            
              Iterator iterDebug = stringList.iterator();
            
              boolean first = true;
              while(iterDebug.hasNext())
              {
                String str = (String)iterDebug.next();
                if(!first)
                  asString = asString + "," + str;
                else
                {
                  asString = asString + str;
                  first = false;
                }
              }
            }
            asString = asString + ">"; 
            tc.debug(this,cclass, "getValue", debugString + "for identifier " + id.getName() + asString);
          } 
          
          // Build the return value as an XPathEvaluationContext
          if(xpEval == null)
            xpEval = new SetValEvaluationContext();
  
          // Add the wrapped node to the result
          xpEval.addNode(nextWrappedNode);
            
        } // eof while
      } // eof instanceof XPathEvaluationContext
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.exit(this,cclass, "getValue", xpEval);
    return xpEval;
  }
878967
public String getMessage(Context context) {
        if (customMessage != null) {
            return customMessage;
        }
        return context.getResources().getString(message);
    }
1310463
void get(
    Object value,
    MatchSpaceKey msg,
    EvalCache cache,
    Object contextValue,
    SearchResults result)
    throws MatchingException, BadMessageFormatMatchingException
  {
    if (value == null && msg != null)
      value = getValue(msg, contextValue);
    if (value == null)
    {
      if (nullChild != null)
        nullChild.get(null, msg, cache, contextValue, result);
    }
    else
    {
      handleGet(value, msg, cache, contextValue, result);
      if (notNullChild != null)
        notNullChild.get(null, msg, cache, contextValue, result);
    }
    super.get(null, msg, cache, contextValue, result);
  }
411332
public static Context withValue(Context context, @javax.annotation.Nullable Span span) {
    return Utils.checkNotNull(context, "context").withValue(CONTEXT_SPAN_KEY, span);
  }
1193144
public void setValue(FacesContext context, Object value)
            throws EvaluationException, PropertyNotFoundException {
            
        if (context == null) {
	        throw new NullPointerException("FacesContext -> null");
        }
        try {
            valueExpression.setValue(context.getELContext(), value);
        } catch (javax.el.PropertyNotFoundException pnfe) {
            throw new PropertyNotFoundException(pnfe);
        } catch (javax.el.PropertyNotWritableException pnwe) {
            throw new PropertyNotFoundException(pnwe);
        } catch (ELException elex) {
            throw new EvaluationException(elex);
        }
    }
1252404
public static <T extends CharSequence> T validateLetter(T value, String errorMsg) throws ValidateException {
		if (false == isLetter(value)) {
			throw new ValidateException(errorMsg);
		}
		return value;
	}
39115
@Override
    public String getValue(String variable) throws NotAvailableException {
        String key;
        for (Map.Entry<Descriptors.FieldDescriptor, Object> fieldEntry : message.getAllFields().entrySet()) {
            key = StringProcessor.transformToUpperCase(fieldEntry.getKey().getName());
            if (key.equals(variable) || (StringProcessor.transformToUpperCase(message.getClass().getSimpleName()) + "/" + key).equals(variable)) {
                if (!fieldEntry.getValue().toString().isEmpty()) {
                    return fieldEntry.getValue().toString();
                }
            }
        }
        throw new NotAvailableException("Value for Variable[" + variable + "]");
    }
468803
Object getValue(
    MatchSpaceKey msg,
    Object contextValue)
    throws MatchingException, BadMessageFormatMatchingException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.entry(
        cclass,
        "getValue",
        "msg: " + msg + "contextValue: " + contextValue);
    
    // The value which we'll return    
    SetValEvaluationContext xpEval = null;
  
    // May need to call MFP multiple times, if our context has multiple nodes
    if(contextValue != null)
    {
      // Currently this must be a list of nodes
      if (contextValue instanceof SetValEvaluationContext)
      {
        SetValEvaluationContext evalContext = (SetValEvaluationContext)contextValue;

        // Get the node list
        ArrayList wrappedParentList = evalContext.getWrappedNodeList();
        
        // If the list is empty, then we have yet to get the document root
        if(wrappedParentList.isEmpty())
        {
    	    //Set up a root (document) context for evaluation
        	Object docRoot = Matching.getEvaluator().getDocumentRoot(msg);
            
          // Create an object to hold the wrapped node
          WrappedNodeResults wrapper = new WrappedNodeResults(docRoot);
          // Set the root into the evaluation context
          evalContext.addNode(wrapper);
        }
        
        // Iterate over the nodes        
        Iterator iter = wrappedParentList.iterator();

        while(iter.hasNext())
        {
          WrappedNodeResults nextWrappedParentNode = (WrappedNodeResults)iter.next();       
          Object nextParentNode = nextWrappedParentNode.getNode();
          
          String debugString = "";
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            tc.debug(this,cclass, "getValue", "Evaluation context node: " + nextWrappedParentNode); 
          
          ArrayList wrappedChildList = nextWrappedParentNode.getEvalListResult(id.getName());
            
          // If not cached we'll need to go to MFP
          if(wrappedChildList == null)
          {
            // Call MFP to get the results for this node
            ArrayList nodeList = 
              (ArrayList) msg.getIdentifierValue(id,
                                                 false,
                                                 nextParentNode, 
                                                 true); // true means return a nodelist
            wrappedChildList = new ArrayList();
            
            if(nodeList != null)
            {
              Iterator iterNode = nodeList.iterator();
              
              while(iterNode.hasNext())
              {
                Object theNode = (Object)iterNode.next();

                // Create an object to hold the wrapped node
                WrappedNodeResults wrapper = new WrappedNodeResults(theNode);
                wrappedChildList.add(wrapper); 
              }              
            }
            // Add result to cache for next time
            nextWrappedParentNode.addEvalListResult(id.getName(), wrappedChildList);
            
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
              debugString = "Result from MFP ";
          }
          else
          {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
              debugString = "Result from Cache ";
          }

          // Useful debug
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
          {
            Iterator iterDebug = wrappedChildList.iterator();
            String asString = ", type: List - ";
            while(iterDebug.hasNext())
            {
              WrappedNodeResults wrapper = (WrappedNodeResults)iterDebug.next();
              asString = asString + "<" + wrapper + ">"; 
            }
            tc.debug(this,cclass, "getValue", debugString + "for identifier " + id.getName() + asString);
          }          
          
          if(!wrappedChildList.isEmpty())
          {
            // Build the return value as an XPathEvaluationContext
            if(xpEval == null)
              xpEval = new SetValEvaluationContext();
  
            // Add the wrapped node to the result
            xpEval.addWrappedNodeList(wrappedChildList);                      
          } 
        } // eof while
      } // eof instanceof XPathEvaluationContext
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.exit(this,cclass, "getValue", xpEval);
    
    return xpEval;
  }
873556
@Override
    public Object getRootContext() throws BadMessageFormatMatchingException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getRootContext");

        // Just call the subclass's method to obtain the DOM Document which
        // represents the payload.
        Object result;
        try {
            result = getPayloadDocument();
        } catch (Exception e) {
            FFDCFilter.processException(e, "com.ibm.ws.sib.mfp.impl.JsApiMessageImpl.getRootContext", "921");
            result = null;
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "getRootContext", result);
        return result;
    }
653633
public <R> R get(@NotNull final String name, R defaultValue) {
        if (context.containsKey(name)) {
            return get(name);
        } else {
            return defaultValue;
        }
    }
1101310
public Object execute(final Object value, final CsvContext context) {
		validateInputNotNull(value, context);
		
		final boolean matches = regexPattern.matcher((String) value).matches();
		if( !matches ) {
			final String msg = REGEX_MSGS.get(regex);
			if( msg == null ) {
				throw new SuperCsvConstraintViolationException(String.format(
					"'%s' does not match the regular expression '%s'", value, regex), context, this);
			} else {
				throw new SuperCsvConstraintViolationException(
					String.format("'%s' does not match the constraint '%s' defined by the regular expression '%s'",
						value, msg, regex), context, this);
			}
		}
		return next.execute(value, context);
	}
526508
public String getValueWithDefault(String keyMsgType, String defaultVal) {
        return keyToValue.getOrDefault(keyMsgType, defaultVal);
    }
600774
@Override
    protected String getEscapedValue(HttpMessage msg, String value) {
        // ZAP: unfortunately the method setQuery() defined inside the httpclient Apache component
        // create trouble when special characters like ?+? are set inside the parameter, 
        // because this method implementation simply doesn't encode them.
        // So we have to explicitly encode values using the URLEncoder component before setting it.
        return (value != null) ? 
                AbstractPlugin.getURLEncode(value) : "";
    }
595524
public String getStringValue(FacesContext context) {
        String result = null;
        if (hasValueExpression()) {
            result = getStringValueFromModel(context);
        } else {
            result = (null != rawValue) ? rawValue : (String) getValue();
        }
        return result;
    }
287207
public ValueReference getValueReference(ELContext context) {
        // Expected to be over-ridden by implementation
        context.notifyBeforeEvaluation(getExpressionString());
        context.notifyAfterEvaluation(getExpressionString());
        return null;
    }
1306947
function getValue(context, token) {
    // Reference token evaluation. See Section 4 of spec.

    // First of all we should unescape all special characters in token.
    token = unescapeReferenceToken(token);

    // Further actions depend of context of evaluation.

    if (isArray(context)) {
      // In array context there are more strict requirements
      // for token value.

      if ('-' === token) {
        // Token cannot be a "-" character,
        // it has no sense in current implementation.
        throw getError(ErrorMessage.HYPHEN_IS_NOT_SUPPORTED_IN_ARRAY_CONTEXT);
      }
      if (!isNumber(token)) {
        // Token cannot be non-number.
        throw getError(ErrorMessage.NON_NUMBER_TOKEN_IN_ARRAY_CONTEXT);
      }
      if (token.length > 1 && '0' === token[0]) {
        // Token cannot be non-zero number with leading zero.
        throw getError(ErrorMessage.TOKEN_WITH_LEADING_ZERO_IN_ARRAY_CONTEXT);
      }
      // If all conditions are met, simply return element
      // with token's value index.
      // It might be undefined, but it's ok.
      return context[token];
    }

    if (isObject(context)) {
      // In object context we can simply return element w/ key equal to token.
      // It might be undefined, but it's ok.
      return context[token];
    }

    // If context is not an array or an object,
    // token evaluation is not possible.
    // This is the expected situation and so we won't throw an error,
    // undefined value is perfectly suitable here.
    return;
  }
1074413
public Object execute(final Object value, final CsvContext context) {
		validateInputNotNull(value, context);
		if (!(value instanceof String)) {
			throw new SuperCsvCellProcessorException(String.class, value,
					context, this);
		}

		final String string = (String) value;
		final T result;
		try {
			if (formatter != null) {
				result = parse(string, formatter);
			} else {
				result = parse(string);
			}
		} catch (IllegalArgumentException e) {
			throw new SuperCsvCellProcessorException("Failed to parse value",
					context, this, e);
		}

		return next.execute(result, context);
	}