Tabnine Logo
CallParamRule.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.commons.digester.CallParamRule
constructor

Best Java code snippets using org.apache.commons.digester.CallParamRule.<init> (Showing top 13 results out of 315)

origin: commons-digester/commons-digester

/**
 * {@inheritDoc}
 */
public CallParamRule get() {
  return new CallParamRule(this.paramIndex, this.stackIndex);
}
origin: commons-digester/commons-digester

/**
 * {@inheritDoc}
 */
public CallParamRule get() {
  return new CallParamRule(this.index);
}
origin: commons-digester/commons-digester

/**
 * {@inheritDoc}
 */
public CallParamRule get() {
  return new CallParamRule(this.index, this.attribute);
}
origin: commons-digester/commons-digester

/**
 * Add a "call parameter" rule for the specified parameters.
 *
 * @param pattern Element matching pattern
 * @param paramIndex Zero-relative parameter index to set
 *  (from the body of this element)
 * @see CallParamRule
 */
public void addCallParam(String pattern, int paramIndex) {
  addRule(pattern,
      new CallParamRule(paramIndex));
}
origin: commons-digester/commons-digester

/**
 * Add a "call parameter" rule.
 * This will either take a parameter from the stack 
 * or from the current element body text. 
 *
 * @param paramIndex The zero-relative parameter number
 * @param fromStack Should the call parameter be taken from the top of the stack?
 * @see CallParamRule
 */    
public void addCallParam(String pattern, int paramIndex, boolean fromStack) {

  addRule(pattern,
      new CallParamRule(paramIndex, fromStack));
 
}
origin: commons-digester/commons-digester

/**
 * Add a "call parameter" rule that sets a parameter from the stack.
 * This takes a parameter from the given position on the stack.
 *
 * @param paramIndex The zero-relative parameter number
 * @param stackIndex set the call parameter to the stackIndex'th object down the stack,
 * where 0 is the top of the stack, 1 the next element down and so on
 * @see CallMethodRule
 */    
public void addCallParam(String pattern, int paramIndex, int stackIndex) {

  addRule(pattern,
      new CallParamRule(paramIndex, stackIndex));
 
}

origin: commons-digester/commons-digester

/**
 * Add a "call parameter" rule for the specified parameters.
 *
 * @param pattern Element matching pattern
 * @param paramIndex Zero-relative parameter index to set
 *  (from the specified attribute)
 * @param attributeName Attribute whose value is used as the
 *  parameter value
 * @see CallParamRule
 */
public void addCallParam(String pattern, int paramIndex,
             String attributeName) {
  addRule(pattern,
      new CallParamRule(paramIndex, attributeName));
}
origin: commons-digester/commons-digester

  @Override
  public Object createObject(Attributes attributes) {
    // create callparamrule
    int paramIndex = Integer.parseInt(attributes.getValue("paramnumber"));
    String attributeName = attributes.getValue("attrname");
    String fromStack = attributes.getValue("from-stack");
    String stackIndex = attributes.getValue("stack-index");
    Rule callParamRule = null;
    if (attributeName == null) {
      if (stackIndex != null) {                    
        callParamRule = new CallParamRule(
          paramIndex, Integer.parseInt(stackIndex));                
      } else if (fromStack != null) {                
        callParamRule = new CallParamRule(
          paramIndex, Boolean.valueOf(fromStack).booleanValue());                
      } else {
        callParamRule = new CallParamRule(paramIndex);     
      }
    } else {
      if (fromStack == null) {
        callParamRule = new CallParamRule(paramIndex, attributeName);                    
      } else {
        // specifying both from-stack and attribute name is not allowed
        throw new RuntimeException(
          "Attributes from-stack and attrname cannot both be present.");
      }
    }
    return callParamRule;
  }
}
origin: com.alibaba.citrus.tool/antx-autoexpand

/**
 * Add a "call parameter" rule that sets a parameter from the stack.
 * This takes a parameter from the given position on the stack.
 *
 * @param paramIndex The zero-relative parameter number
 * @param stackIndex set the call parameter to the stackIndex'th object down the stack,
 * where 0 is the top of the stack, 1 the next element down and so on
 * @see CallMethodRule
 */    
public void addCallParam(String pattern, int paramIndex, int stackIndex) {

  addRule(pattern,
      new CallParamRule(paramIndex, stackIndex));
 
}
 
origin: com.alibaba.citrus.tool/antx-autoexpand

/**
 * Add a "call parameter" rule for the specified parameters.
 *
 * @param pattern Element matching pattern
 * @param paramIndex Zero-relative parameter index to set
 *  (from the body of this element)
 * @see CallParamRule
 */
public void addCallParam(String pattern, int paramIndex) {
  addRule(pattern,
      new CallParamRule(paramIndex));
}
origin: com.alibaba.citrus.tool/antx-autoexpand

/**
 * Add a "call parameter" rule.
 * This will either take a parameter from the stack 
 * or from the current element body text. 
 *
 * @param paramIndex The zero-relative parameter number
 * @param fromStack Should the call parameter be taken from the top of the stack?
 * @see CallParamRule
 */    
public void addCallParam(String pattern, int paramIndex, boolean fromStack) {

  addRule(pattern,
      new CallParamRule(paramIndex, fromStack));
 
}
origin: com.alibaba.citrus.tool/antx-autoexpand

  public Object createObject(Attributes attributes) {
    // create callparamrule
    int paramIndex = Integer.parseInt(attributes.getValue("paramnumber"));
    String attributeName = attributes.getValue("attrname");
    String fromStack = attributes.getValue("from-stack");
    String stackIndex = attributes.getValue("stack-index");
    Rule callParamRule = null;
    if (attributeName == null) {
      if (stackIndex != null) {                    
        callParamRule = new CallParamRule(
          paramIndex, Integer.parseInt(stackIndex));                
      } else if (fromStack != null) {                
        callParamRule = new CallParamRule(
          paramIndex, Boolean.valueOf(fromStack).booleanValue());                
      } else {
        callParamRule = new CallParamRule(paramIndex);     
      }
    } else {
      if (fromStack == null) {
        callParamRule = new CallParamRule(paramIndex, attributeName);                    
      } else {
        // specifying both from-stack and attribute name is not allowed
        throw new RuntimeException(
          "Attributes from-stack and attrname cannot both be present.");
      }
    }
    return callParamRule;
  }
}
origin: com.alibaba.citrus.tool/antx-autoexpand

/**
 * Add a "call parameter" rule for the specified parameters.
 *
 * @param pattern Element matching pattern
 * @param paramIndex Zero-relative parameter index to set
 *  (from the specified attribute)
 * @param attributeName Attribute whose value is used as the
 *  parameter value
 * @see CallParamRule
 */
public void addCallParam(String pattern, int paramIndex,
             String attributeName) {
  addRule(pattern,
      new CallParamRule(paramIndex, attributeName));
}
org.apache.commons.digesterCallParamRule<init>

Javadoc

Construct a "call parameter" rule that will save the body text of this element as the parameter value.

Note that if the element is empty the an empty string is passed to the target method, not null. And if automatic type conversion is being applied (ie if the target function takes something other than a string as a parameter) then the conversion will fail if the converter class does not accept an empty string as valid input.

Popular methods of CallParamRule

    Popular in Java

    • Start an intent from android
    • getSharedPreferences (Context)
    • setContentView (Activity)
    • addToBackStack (FragmentTransaction)
    • Point (java.awt)
      A point representing a location in (x,y) coordinate space, specified in integer precision.
    • BufferedWriter (java.io)
      Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
    • URI (java.net)
      A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
    • URL (java.net)
      A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
    • Arrays (java.util)
      This class contains various methods for manipulating arrays (such as sorting and searching). This cl
    • PriorityQueue (java.util)
      A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
    • Top plugins for Android Studio
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now