FileDocCategorySizeDatePackage
FuncConcat.javaAPI DocJava SE 6 API2634Tue Jun 10 00:23:14 BST 2008com.sun.org.apache.xpath.internal.functions

FuncConcat

public class FuncConcat extends FunctionMultiArgs
Execute the Concat() function.
xsl.usage
advanced

Fields Summary
static final long
serialVersionUID
Constructors Summary
Methods Summary
public voidcheckNumberArgs(int argNum)
Check that the number of arguments passed to this function is correct.

param
argNum The number of arguments that is being passed to the function.
throws
WrongNumberArgsException

    if (argNum < 2)
      reportWrongNumberArgs();
  
public com.sun.org.apache.xpath.internal.objects.XObjectexecute(com.sun.org.apache.xpath.internal.XPathContext xctxt)
Execute the function. The function must return a valid object.

param
xctxt The current execution context.
return
A valid XObject.
throws
javax.xml.transform.TransformerException


                            
       
  

    StringBuffer sb = new StringBuffer();

    // Compiler says we must have at least two arguments.
    sb.append(m_arg0.execute(xctxt).str());
    sb.append(m_arg1.execute(xctxt).str());

    if (null != m_arg2)
      sb.append(m_arg2.execute(xctxt).str());

    if (null != m_args)
    {
      for (int i = 0; i < m_args.length; i++)
      {
        sb.append(m_args[i].execute(xctxt).str());
      }
    }

    return new XString(sb.toString());
  
protected voidreportWrongNumberArgs()
Constructs and throws a WrongNumberArgException with the appropriate message for this function object.

throws
WrongNumberArgsException

      throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("gtone", null));