Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import javax.lang.model.element.ExecutableElement;

public class Main {
    public static String nameWithoutJavaBeansPrefix(ExecutableElement element) {
        final String rawName = element.getSimpleName().toString();
        return nameWithoutJavaBeansPrefix(rawName);
    }

    public static String nameWithoutJavaBeansPrefix(String rawName) {
        if (rawName.startsWith("get") && !rawName.equals("get")) {
            return rawName.substring(3);
        } else if (rawName.startsWith("is") && !rawName.equals("is")) {
            return rawName.substring(2);
        } else if (rawName.startsWith("set") && !rawName.equals("set")) {
            return rawName.substring(3);
        }
        return rawName;
    }
}