Java 类org.mozilla.javascript.annotations.JSGetter 实例源码

项目:HL4A    文件:ScriptableObject.java   
private static String getPropertyName(String methodName,
                                      String prefix,
                                      Annotation annotation) {
    if (prefix != null) {
        return methodName.substring(prefix.length());
    }
    String propName = null;
    if (annotation instanceof JSGetter) {
        propName = ((JSGetter) annotation).value();
        if (propName == null || propName.length() == 0) {
            if (methodName.length() > 1 && (methodName.startsWith("取") || methodName.startsWith("get"))) {
                propName = methodName.substring(3);
                if (Character.isUpperCase(propName.charAt(0))) {
                    if (propName.length() == 1) {
                        propName = propName.toLowerCase();
                    } else if (!Character.isUpperCase(propName.charAt(1))){
                        propName = Character.toLowerCase(propName.charAt(0))
                                + propName.substring(1);
                    }
                }
            }
        }
    } else if (annotation instanceof JSFunction) {
        propName = ((JSFunction) annotation).value();
    } else if (annotation instanceof JSStaticFunction) {
        propName = ((JSStaticFunction) annotation).value();
    }
    if (propName == null || propName.length() == 0) {
        propName = methodName;
    }
    return propName;
}
项目:whackpad    文件:ScriptableObject.java   
private static String getPropertyName(String methodName,
                                      String prefix,
                                      Annotation annotation) {
    if (prefix != null) {
        return methodName.substring(prefix.length());
    }
    String propName = null;
    if (annotation instanceof JSGetter) {
        propName = ((JSGetter) annotation).value();
        if (propName == null || propName.length() == 0) {
            if (methodName.length() > 3 && methodName.startsWith("get")) {
                propName = methodName.substring(3);
                if (Character.isUpperCase(propName.charAt(0))) {
                    if (propName.length() == 1) {
                        propName = propName.toLowerCase();
                    } else if (!Character.isUpperCase(propName.charAt(1))){
                        propName = Character.toLowerCase(propName.charAt(0))
                                + propName.substring(1);
                    }
                }
            }
        }
    } else if (annotation instanceof JSFunction) {
        propName = ((JSFunction) annotation).value();
    } else if (annotation instanceof JSStaticFunction) {
        propName = ((JSStaticFunction) annotation).value();
    }
    if (propName == null || propName.length() == 0) {
        propName = methodName;
    }
    return propName;
}
项目:TaleCraft    文件:ScriptableObject.java   
private static String getPropertyName(String methodName,
                                      String prefix,
                                      Annotation annotation) {
    if (prefix != null) {
        return methodName.substring(prefix.length());
    }
    String propName = null;
    if (annotation instanceof JSGetter) {
        propName = ((JSGetter) annotation).value();
        if (propName == null || propName.length() == 0) {
            if (methodName.length() > 3 && methodName.startsWith("get")) {
                propName = methodName.substring(3);
                if (Character.isUpperCase(propName.charAt(0))) {
                    if (propName.length() == 1) {
                        propName = propName.toLowerCase();
                    } else if (!Character.isUpperCase(propName.charAt(1))){
                        propName = Character.toLowerCase(propName.charAt(0))
                                + propName.substring(1);
                    }
                }
            }
        }
    } else if (annotation instanceof JSFunction) {
        propName = ((JSFunction) annotation).value();
    } else if (annotation instanceof JSStaticFunction) {
        propName = ((JSStaticFunction) annotation).value();
    }
    if (propName == null || propName.length() == 0) {
        propName = methodName;
    }
    return propName;
}
项目:code404    文件:ScriptableObject.java   
private static String getPropertyName(String methodName,
                                      String prefix,
                                      Annotation annotation) {
    if (prefix != null) {
        return methodName.substring(prefix.length());
    }
    String propName = null;
    if (annotation instanceof JSGetter) {
        propName = ((JSGetter) annotation).value();
        if (propName == null || propName.length() == 0) {
            if (methodName.length() > 3 && methodName.startsWith("get")) {
                propName = methodName.substring(3);
                if (Character.isUpperCase(propName.charAt(0))) {
                    if (propName.length() == 1) {
                        propName = propName.toLowerCase();
                    } else if (!Character.isUpperCase(propName.charAt(1))){
                        propName = Character.toLowerCase(propName.charAt(0))
                                + propName.substring(1);
                    }
                }
            }
        }
    } else if (annotation instanceof JSFunction) {
        propName = ((JSFunction) annotation).value();
    } else if (annotation instanceof JSStaticFunction) {
        propName = ((JSStaticFunction) annotation).value();
    }
    if (propName == null || propName.length() == 0) {
        propName = methodName;
    }
    return propName;
}
项目:rhino-jscover    文件:ScriptableObject.java   
private static String getPropertyName(String methodName,
                                      String prefix,
                                      Annotation annotation) {
    if (prefix != null) {
        return methodName.substring(prefix.length());
    }
    String propName = null;
    if (annotation instanceof JSGetter) {
        propName = ((JSGetter) annotation).value();
        if (propName == null || propName.length() == 0) {
            if (methodName.length() > 3 && methodName.startsWith("get")) {
                propName = methodName.substring(3);
                if (Character.isUpperCase(propName.charAt(0))) {
                    if (propName.length() == 1) {
                        propName = propName.toLowerCase();
                    } else if (!Character.isUpperCase(propName.charAt(1))){
                        propName = Character.toLowerCase(propName.charAt(0))
                                + propName.substring(1);
                    }
                }
            }
        }
    } else if (annotation instanceof JSFunction) {
        propName = ((JSFunction) annotation).value();
    } else if (annotation instanceof JSStaticFunction) {
        propName = ((JSStaticFunction) annotation).value();
    }
    if (propName == null || propName.length() == 0) {
        propName = methodName;
    }
    return propName;
}
项目:LoboEvolution    文件:ScriptableObject.java   
private static String getPropertyName(String methodName,
                                      String prefix,
                                      Annotation annotation) {
    if (prefix != null) {
        return methodName.substring(prefix.length());
    }
    String propName = null;
    if (annotation instanceof JSGetter) {
        propName = ((JSGetter) annotation).value();
        if (propName == null || propName.length() == 0) {
            if (methodName.length() > 3 && methodName.startsWith("get")) {
                propName = methodName.substring(3);
                if (Character.isUpperCase(propName.charAt(0))) {
                    if (propName.length() == 1) {
                        propName = propName.toLowerCase();
                    } else if (!Character.isUpperCase(propName.charAt(1))){
                        propName = Character.toLowerCase(propName.charAt(0))
                                + propName.substring(1);
                    }
                }
            }
        }
    } else if (annotation instanceof JSFunction) {
        propName = ((JSFunction) annotation).value();
    } else if (annotation instanceof JSStaticFunction) {
        propName = ((JSStaticFunction) annotation).value();
    }
    if (propName == null || propName.length() == 0) {
        propName = methodName;
    }
    return propName;
}
项目:astor    文件:ScriptableObject.java   
private static String getPropertyName(String methodName,
                                      String prefix,
                                      Annotation annotation) {
    if (prefix != null) {
        return methodName.substring(prefix.length());
    }
    String propName = null;
    if (annotation instanceof JSGetter) {
        propName = ((JSGetter) annotation).value();
        if (propName == null || propName.length() == 0) {
            if (methodName.length() > 3 && methodName.startsWith("get")) {
                propName = methodName.substring(3);
                if (Character.isUpperCase(propName.charAt(0))) {
                    if (propName.length() == 1) {
                        propName = propName.toLowerCase();
                    } else if (!Character.isUpperCase(propName.charAt(1))){
                        propName = Character.toLowerCase(propName.charAt(0))
                                + propName.substring(1);
                    }
                }
            }
        }
    } else if (annotation instanceof JSFunction) {
        propName = ((JSFunction) annotation).value();
    } else if (annotation instanceof JSStaticFunction) {
        propName = ((JSStaticFunction) annotation).value();
    }
    if (propName == null || propName.length() == 0) {
        propName = methodName;
    }
    return propName;
}
项目:Rhino-Prov-Mod    文件:ScriptableObject.java   
private static String getPropertyName(String methodName,
                                      String prefix,
                                      Annotation annotation) {
    if (prefix != null) {
        return methodName.substring(prefix.length());
    }
    String propName = null;
    if (annotation instanceof JSGetter) {
        propName = ((JSGetter) annotation).value();
        if (propName == null || propName.length() == 0) {
            if (methodName.length() > 3 && methodName.startsWith("get")) {
                propName = methodName.substring(3);
                if (Character.isUpperCase(propName.charAt(0))) {
                    if (propName.length() == 1) {
                        propName = propName.toLowerCase();
                    } else if (!Character.isUpperCase(propName.charAt(1))){
                        propName = Character.toLowerCase(propName.charAt(0))
                                + propName.substring(1);
                    }
                }
            }
        }
    } else if (annotation instanceof JSFunction) {
        propName = ((JSFunction) annotation).value();
    } else if (annotation instanceof JSStaticFunction) {
        propName = ((JSStaticFunction) annotation).value();
    }
    if (propName == null || propName.length() == 0) {
        propName = methodName;
    }
    return propName;
}
项目:android-js    文件:ScriptableObject.java   
private static String getPropertyName(String methodName,
                                      String prefix,
                                      Annotation annotation) {
    if (prefix != null) {
        return methodName.substring(prefix.length());
    }
    String propName = null;
    if (annotation instanceof JSGetter) {
        propName = ((JSGetter) annotation).value();
        if (propName == null || propName.length() == 0) {
            if (methodName.length() > 3 && methodName.startsWith("get")) {
                propName = methodName.substring(3);
                if (Character.isUpperCase(propName.charAt(0))) {
                    if (propName.length() == 1) {
                        propName = propName.toLowerCase();
                    } else if (!Character.isUpperCase(propName.charAt(1))){
                        propName = Character.toLowerCase(propName.charAt(0))
                                + propName.substring(1);
                    }
                }
            }
        }
    } else if (annotation instanceof JSFunction) {
        propName = ((JSFunction) annotation).value();
    } else if (annotation instanceof JSStaticFunction) {
        propName = ((JSStaticFunction) annotation).value();
    }
    if (propName == null || propName.length() == 0) {
        propName = methodName;
    }
    return propName;
}
项目:eggshell    文件:Egg.java   
/** Check if the job finished or not
 *  @return Job completion status
 */
@JSGetter
public Boolean getIsComplete ()
  throws IOException
{
  return job.isComplete();
}
项目:eggshell    文件:Egg.java   
/** Check if the job finished successfully or not
 *  @return Job success status
 */
@JSGetter
public Boolean getIsSuccessful ()
  throws IOException
{
  return job.isSuccessful();
}
项目:eggshell    文件:Egg.java   
/** Get the progress of the job's map tasks
 *  @return  A progress value between 0.0 and 1.0.
 */
@JSGetter
public Double getMapProgress ()
  throws IOException
{
  return (double) job.mapProgress();
}
项目:eggshell    文件:Egg.java   
/** Get the progress of the job's reduce tasks
 *  @return  A progress value between 0.0 and 1.0.
 */
@JSGetter
public Double getReduceProgress ()
  throws IOException
{
  return (double) job.reduceProgress();
}
项目:eggshell    文件:Egg.java   
/** Get the progress of the job's setup
 *  @return  A progress value between 0.0 and 1.0.
 */
@JSGetter
public Double getSetupProgress ()
  throws IOException
{
  return (double) job.setupProgress();
}
项目:closure-compiler-old    文件:ScriptableObject.java   
private static String getPropertyName(String methodName,
                                      String prefix,
                                      Annotation annotation) {
    if (prefix != null) {
        return methodName.substring(prefix.length());
    }
    String propName = null;
    if (annotation instanceof JSGetter) {
        propName = ((JSGetter) annotation).value();
        if (propName == null || propName.length() == 0) {
            if (methodName.length() > 3 && methodName.startsWith("get")) {
                propName = methodName.substring(3);
                if (Character.isUpperCase(propName.charAt(0))) {
                    if (propName.length() == 1) {
                        propName = propName.toLowerCase();
                    } else if (!Character.isUpperCase(propName.charAt(1))){
                        propName = Character.toLowerCase(propName.charAt(0))
                                + propName.substring(1);
                    }
                }
            }
        }
    } else if (annotation instanceof JSFunction) {
        propName = ((JSFunction) annotation).value();
    } else if (annotation instanceof JSStaticFunction) {
        propName = ((JSStaticFunction) annotation).value();
    }
    if (propName == null || propName.length() == 0) {
        propName = methodName;
    }
    return propName;
}
项目:closure-compiler-copy    文件:ScriptableObject.java   
private static String getPropertyName(String methodName,
                                      String prefix,
                                      Annotation annotation) {
    if (prefix != null) {
        return methodName.substring(prefix.length());
    }
    String propName = null;
    if (annotation instanceof JSGetter) {
        propName = ((JSGetter) annotation).value();
        if (propName == null || propName.length() == 0) {
            if (methodName.length() > 3 && methodName.startsWith("get")) {
                propName = methodName.substring(3);
                if (Character.isUpperCase(propName.charAt(0))) {
                    if (propName.length() == 1) {
                        propName = propName.toLowerCase();
                    } else if (!Character.isUpperCase(propName.charAt(1))){
                        propName = Character.toLowerCase(propName.charAt(0))
                                + propName.substring(1);
                    }
                }
            }
        }
    } else if (annotation instanceof JSFunction) {
        propName = ((JSFunction) annotation).value();
    } else if (annotation instanceof JSStaticFunction) {
        propName = ((JSStaticFunction) annotation).value();
    }
    if (propName == null || propName.length() == 0) {
        propName = methodName;
    }
    return propName;
}
项目:rhino-android    文件:DefineClassTest.java   
@JSGetter
public String getFoo() {
    return foo;
}
项目:rhino-android    文件:DefineClassTest.java   
@JSGetter("bar")
public String getMyBar() {
    return bar;
}
项目:code404    文件:Counter.java   
@JSGetter
public int getCount() { return count++; }
项目:code404    文件:File.java   
@JSGetter
public int getLineNumber()
    throws FileNotFoundException
{
    return getReader().getLineNumber();
}
项目:rhino-jscover    文件:Counter.java   
@JSGetter
public int getCount() { return count++; }
项目:rhino-jscover    文件:File.java   
@JSGetter
public int getLineNumber()
    throws FileNotFoundException
{
    return getReader().getLineNumber();
}
项目:astor    文件:Counter.java   
@JSGetter
public int getCount() { return count++; }
项目:astor    文件:File.java   
@JSGetter
public int getLineNumber()
    throws FileNotFoundException
{
    return getReader().getLineNumber();
}
项目:Rhino-Prov-Mod    文件:Counter.java   
@JSGetter
public int getCount() { return count++; }
项目:Rhino-Prov-Mod    文件:File.java   
@JSGetter
public int getLineNumber()
    throws FileNotFoundException
{
    return getReader().getLineNumber();
}
项目:eggshell    文件:Egg.java   
/** Get the encapsulated job object
 *  @return The job object
 */
@JSGetter
public Job getJob ()
{
  return job;
}
项目:eggshell    文件:Egg.java   
/** Get the pathname of the job's jar
 *  @return The pathname
 */
@JSGetter
public String getJar ()
{
  return job.getJar();
}
项目:eggshell    文件:Egg.java   
/** Get the URL for tracking the job's progress
 *  @return The URL
 */
@JSGetter
public String getTrackingURL ()
{
  return job.getTrackingURL();
}
项目:eggshell    文件:EggContext.java   
/** Get the task attempt ID for the task
 *  @return The Hadoop task attempt ID
 */
@JSGetter
public String getTaskAttemptID ()
{
  return task.getTaskAttemptID().toString();
}
项目:eggshell    文件:EggContext.java   
/** Get the task context that this object encapsulates
 *  @return The Hadoop task context
 */
@JSGetter
public TaskInputOutputContext getContext ()
{
  return task;
}
项目:eggshell    文件:EggContext.java   
/** Get the Hadoop Configuration object
 *  @return The Hadoop configuration
 */
@JSGetter
public Configuration getConfiguration ()
{
  return task.getConfiguration();
}
项目:eggshell    文件:EggContext.java   
/** Get the Job ID for the task
 *  @return The Hadoop job id
 */
@JSGetter
public String getJobID ()
{
  return task.getJobID().toString();
}
项目:eggshell    文件:EggContext.java   
/** Get the user-specified job name for the task
 *  @return The Hadoop job name
 */
@JSGetter
public String getJobName ()
{
  return task.getJobName();
}
项目:eggshell    文件:EggContext.java   
/** Get the status message for the task.
 *  @return The status message
 */
@JSGetter
public String getStatus ()
{
  return task.getStatus();
}
项目:eggshell    文件:EggGlobal.java   
/** Get the standard error print stream
 *  @return A print stream
 */
@JSGetter
public PrintStream getStderr ()
{
  return System.err;
}
项目:eggshell    文件:EggGlobal.java   
/** Get the standard output print stream
 *  @return A print stream
 */
@JSGetter
public PrintStream getStdout ()
{
  return System.out;
}
项目:closure-compiler-old    文件:Counter.java   
@JSGetter
public int getCount() { return count++; }
项目:closure-compiler-old    文件:File.java   
@JSGetter
public int getLineNumber()
    throws FileNotFoundException
{
    return getReader().getLineNumber();
}
项目:MinecraftScripting    文件:Range.java   
@JSGetter
public int getHigh() {
    return high;
}