Codota Logo
org.jaxen.function
Code IndexAdd Codota to your IDE (free)

How to use org.jaxen.function

Best Java code snippets using org.jaxen.function (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: stackoverflow.com

 ref.takingMethod(new StringFunction() {
  public int func(String param) {
    // body
  }
});
origin: jaxen/jaxen

private static Boolean evaluate(List contextNodes, Object lang, Navigator nav)
 throws UnsupportedAxisException
{
  return evaluate(contextNodes.get(0), 
    StringFunction.evaluate(lang, nav), nav)
    ? Boolean.TRUE : Boolean.FALSE;
}
origin: jaxen/jaxen

  public static Boolean evaluate(Object strArg,
                  Object matchArg,
                  Navigator nav)
  {
    String str   = StringFunction.evaluate( strArg,
                        nav );

    String match = StringFunction.evaluate( matchArg,
                        nav );

    return ( str.endsWith(match)
         ? Boolean.TRUE
         : Boolean.FALSE
         );
  }
}
origin: jaxen/jaxen

new BooleanFunction() );
new CeilingFunction() );
new ConcatFunction() );
new ContainsFunction() );
new CountFunction() );
new FalseFunction() );
new FloorFunction() );
new IdFunction() );
new LangFunction() );
new LastFunction() );
new LocalNameFunction() );
new NameFunction() );
new NamespaceUriFunction() );
new NormalizeSpaceFunction() );
new NotFunction() );
origin: jaxen/jaxen

private boolean evaluateObjectObject( Object lhs, Object rhs, Navigator nav )
 {
 if( eitherIsBoolean( lhs, rhs ) )
  {            
  return evaluateObjectObject( BooleanFunction.evaluate( lhs, nav ),
                 BooleanFunction.evaluate( rhs, nav ) );
  }
 else if( eitherIsNumber( lhs, rhs ) )
  {
  return evaluateObjectObject( NumberFunction.evaluate( lhs,
                             nav ),
                 NumberFunction.evaluate( rhs,
                             nav ) );                                              
  }
 else
  {
  return evaluateObjectObject( StringFunction.evaluate( lhs,
                             nav ),
                 StringFunction.evaluate( rhs,
                             nav ) );
  }
 }

origin: jaxen/jaxen

             Navigator nav) 
String str = StringFunction.evaluate( strArg,
                   nav );
while (read < buffer.length)
  if (isXMLSpace(buffer[read]))
    while(read < buffer.length && isXMLSpace(buffer[read]));
origin: jaxen/jaxen

private boolean evaluateObjectObject( Object lhs, Object rhs, Navigator nav )
 {
 if( lhs == null || rhs == null )
  {
  return false;
  }
 
 Double lhsNum = NumberFunction.evaluate( lhs, nav );
 Double rhsNum = NumberFunction.evaluate( rhs, nav );      
 
 if( NumberFunction.isNaN( lhsNum ) || NumberFunction.isNaN( rhsNum ) )
  {
  return false;
  }
 
 return evaluateDoubleDouble( lhsNum, rhsNum );
 }

origin: jaxen/jaxen

/**
 * Returns <code>Boolean.TRUE</code> if the boolean value of 
 * <code>obj</code> is false, and <code>Boolean.FALSE</code> otherwise.
 * The boolean value is calculated as if by the XPath <code>boolean</code>
 * function. 
 * 
 * @param obj the object whose boolean value is inverted
 * @param nav the <code>Navigator</code> used to calculate the boolean value of <code>obj</code>
 * 
 * @return <code>Boolean.TRUE</code> if the boolean value of 
 * <code>obj</code> is false, and <code>Boolean.FALSE</code> otherwise
 */
public static Boolean evaluate(Object obj, Navigator nav)
{
  return ( ( BooleanFunction.evaluate( obj, nav ).booleanValue() )
       ? Boolean.FALSE
       : Boolean.TRUE
       );
}

origin: jaxen/jaxen

  /** Returns the smallest integer greater than or equal to the argument.
   * If necessary, the argument is first converted to a <code>Double</code>
   * as if by the XPath <code>number()</code> function.
   * 
   * @param obj the object whose ceiling is returned
   * @param nav ignored
   * 
   * @return a <code>Double</code> containing the smallest integer 
   *     greater than or equal to <code>obj</code>
   */
  public static Double evaluate(Object obj,
                 Navigator nav)
  {
    Double value = NumberFunction.evaluate( obj,
                        nav );

    return new Double( Math.ceil( value.doubleValue() ) );
  }
}
origin: jaxen/jaxen

/** Returns <code>Boolean.TRUE</code>
 *
 * @param context ignored
 * @param args an empty list
 * 
 * @return <code>Boolean.TRUE</code>
 * 
 * @throws FunctionCallException if <code>args</code> is not empty
 */
public Object call(Context context,
          List args) throws FunctionCallException
{
  if (args.size() == 0)
  {
    return evaluate();
  }
  throw new FunctionCallException( "true() requires no arguments." );
}
origin: jaxen/jaxen

/** Returns <code>Boolean.FALSE</code>
 *
 * @param context the context at the point in the
 *         expression when the function is called
 * @param args an empty list
 * 
 * @return <code>Boolean.FALSE</code>
 * 
 * @throws FunctionCallException if <code>args</code> is not empty
 */
public Object call(Context context,
          List args) throws FunctionCallException
{
  if (args.size() == 0)
  {
    return evaluate();
  }
  throw new FunctionCallException( "false() requires no arguments." );
}
origin: jaxen/jaxen

/**
 * <p>
 * Returns the number of nodes in the specified node-set.
 * </p>
 * @param context ignored
 * @param args the function arguments
 * 
 * @return a <code>Double</code> giving the integral number of items in the first argument
 * 
 * @throws FunctionCallException if args does not have exactly one 
 *     item; or that item is not a <code>List</code>
 */
public Object call(Context context,
          List args) throws FunctionCallException
{
  if (args.size() == 1)
  {
    return evaluate( args.get(0) );
  }
  throw new FunctionCallException( "count() requires one argument." );
}
origin: jaxen/jaxen

/**
 * Returns the position of the context node in the context node-set.
 * 
 * @param context the context at the point in the
 *         expression where the function is called
 * @param args an empty list
 * 
 * @return a <code>Double</code> containing the context position
 * 
 * @throws FunctionCallException if <code>args</code> is not empty
 * 
 * @see Context#getSize()
 */
public Object call(Context context, List args) throws FunctionCallException 
{
  if ( args.size() == 0 )
  {
    return evaluate( context );
  }
  
  throw new FunctionCallException( "position() does not take any arguments." );
}

origin: jaxen/jaxen

  /**
   * Converts the given string value to lower case using an optional Locale
   * 
   * @param strArg the value which gets converted to a String
   * @param locale the Locale to use for the conversion or null
   *        English should be used
   * @param nav the Navigator to use
   */
  public static String evaluate(Object strArg,
                 Locale locale,
                 Navigator nav)
  {

    String str   = StringFunction.evaluate( strArg,
                        nav );
    // it might be possible to use the xml:lang attribute to
    // pick a default locale
    if (locale == null) locale = Locale.ENGLISH;
    return str.toLowerCase(locale);
    
  }
}
origin: jaxen/jaxen

  /** Returns the largest integer less than or equal to the argument.
   * If necessary, the argument is first converted to a <code>Double</code>
   * as if by the XPath <code>number()</code> function.
   * 
   * @param obj the object whose floor is returned
   * @param nav ignored
   * 
   * @return a <code>Double</code> containing the largest integer less 
   *     than or equal to <code>obj</code>
   */
  public static Double evaluate(Object obj,
                 Navigator nav)
  {
    Double value = NumberFunction.evaluate( obj,
                        nav );

    return new Double( Math.floor( value.doubleValue() ) );
  }
}
origin: jaxen/jaxen

  /**
   * Converts the given string value to upper case using an optional Locale
   * 
   * @param strArg the value which gets converted to a String
   * @param locale the Locale to use for the conversion or null if
   *        English should be used
   * @param nav the Navigator to use
   */
  public static String evaluate(Object strArg,
                 Locale locale,
                 Navigator nav)
  {

    String str   = StringFunction.evaluate( strArg,
                        nav );
    // it might be possible to use the xml:lang attribute to
    // pick a default locale
    if (locale == null) locale = Locale.ENGLISH;
    return str.toUpperCase(locale);
  }
}
origin: jaxen/jaxen

/** 
 * Returns true if the string-value of <code>strArg</code>
 * starts with the string-value of <code>matchArg</code>. 
 * Otherwise it returns false.
 * 
 * @param strArg the object whose string-value searched for the prefix
 * @param matchArg the object whose string-value becomes the prefix string to compare against
 * @param nav the navigator used to calculate the string-values of the arguments
 * 
 * @return <code>Boolean.TRUE</code> if the string-value of <code>strArg</code>
 *     starts with the string-value of <code>matchArg</code>;
 *     otherwise <code>Boolean.FALSE</code>
 * 
 */
public static Boolean evaluate(Object strArg,
                Object matchArg,
                Navigator nav)
{
  String str   = StringFunction.evaluate( strArg,
                      nav );
  String match = StringFunction.evaluate( matchArg,
                      nav );
  return ( str.startsWith(match)
       ? Boolean.TRUE
       : Boolean.FALSE
       );
}
 
origin: jaxen/jaxen

  /** 
   * <p>Returns true if the first string contains the second string; false otherwise.
   * If necessary one or both arguments are converted to a string as if by the XPath
   * <code>string()</code> function.
   * </p>
   * 
   * @param strArg the containing string
   * @param matchArg the contained string
   * @param nav used to calculate the string-values of the first two arguments
   * 
   * @return <code>Boolean.TRUE</code> if true if the first string contains 
   *     the second string; <code>Boolean.FALSE</code> otherwise.
   */
  public static Boolean evaluate(Object strArg,
                  Object matchArg,
                  Navigator nav) 
  {
    String str   = StringFunction.evaluate( strArg,
                        nav );

    String match = StringFunction.evaluate( matchArg,
                        nav );

    return ( ( str.indexOf(match) >= 0)
         ? Boolean.TRUE
         : Boolean.FALSE
         );
  }
}
origin: jaxen/jaxen

             Navigator nav)
String str   = StringFunction.evaluate( strArg,
                    nav );
String match = StringFunction.evaluate( matchArg,
                    nav );
origin: jaxen/jaxen

             Navigator nav)
String str   = StringFunction.evaluate( strArg,
                    nav );
String match = StringFunction.evaluate( matchArg,
                    nav );
org.jaxen.function

Most used classes

  • StringFunction
  • BooleanFunction
  • NumberFunction
  • CeilingFunction
  • ConcatFunction
  • CountFunction,
  • FalseFunction,
  • FloorFunction,
  • IdFunction,
  • LangFunction,
  • LastFunction,
  • LocalNameFunction,
  • NameFunction,
  • NamespaceUriFunction,
  • NormalizeSpaceFunction,
  • NotFunction,
  • PositionFunction,
  • RoundFunction,
  • StartsWithFunction
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now