org.apache.axis.wsdl.toJava.Utils.capitalizeFirstChar()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(11.5k)|赞(0)|评价(0)|浏览(82)

本文整理了Java中org.apache.axis.wsdl.toJava.Utils.capitalizeFirstChar()方法的一些代码示例,展示了Utils.capitalizeFirstChar()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.capitalizeFirstChar()方法的具体详情如下:
包路径:org.apache.axis.wsdl.toJava.Utils
类名称:Utils
方法名:capitalizeFirstChar

Utils.capitalizeFirstChar介绍

[英]Capitalize the first character of the name.
[中]将名称的第一个字符大写。

代码示例

代码示例来源:origin: org.apache.axis/axis

/**
 * Map an XML name to a valid Java identifier w/ capitolized first letter
 *
 * @param name
 * @return
 */
public static String xmlNameToJavaClass(String name) {
  return capitalizeFirstChar(xmlNameToJava(name));
}

代码示例来源:origin: axis/axis

/**
 * Map an XML name to a valid Java identifier w/ capitolized first letter
 *
 * @param name
 * @return
 */
public static String xmlNameToJavaClass(String name) {
  return capitalizeFirstChar(xmlNameToJava(name));
}

代码示例来源:origin: org.apache.axis/com.springsource.org.apache.axis

/**
 * Map an XML name to a valid Java identifier w/ capitolized first letter
 *
 * @param name
 * @return
 */
public static String xmlNameToJavaClass(String name) {
  return capitalizeFirstChar(xmlNameToJava(name));
}

代码示例来源:origin: axis/axis

/**
 * Utility function to get the bean property name (as will be returned
 * by the Introspector) for a given field name.  This just means
 * we capitalize the first character if the second character is
 * capitalized.  Example: a field named "fOO" will turn into
 * getter/setter methods "getFOO()/setFOO()".  So when the Introspector
 * looks at that bean, the property name will be "FOO", not "fOO" due
 * to the rules in the JavaBeans spec.  So this makes sure the
 * metadata will match. <p>
 *
 * The method also makes sure that the returned property name is not in
 * the set of reserved properties as defined by {@link #reservedPropNames}.     
 *  
 * @param fieldName 
 * @return 
 */
private String getAsFieldName(String fieldName) {
  // If there's a second character, and it is uppercase, then the
  // bean property name will have a capitalized first character
  // (because setURL() maps to a property named "URL", not "uRL")
  if ((fieldName.length() > 1)
      && Character.isUpperCase(fieldName.charAt(1))) {
    fieldName = Utils.capitalizeFirstChar(fieldName);
  }
  // Make sure the property name is not reserved.
  return JavaUtils.getUniqueValue(reservedPropNames, fieldName);
}

代码示例来源:origin: org.apache.axis/axis

/**
 * Utility function to get the bean property name (as will be returned
 * by the Introspector) for a given field name.  This just means
 * we capitalize the first character if the second character is
 * capitalized.  Example: a field named "fOO" will turn into
 * getter/setter methods "getFOO()/setFOO()".  So when the Introspector
 * looks at that bean, the property name will be "FOO", not "fOO" due
 * to the rules in the JavaBeans spec.  So this makes sure the
 * metadata will match. <p>
 *
 * The method also makes sure that the returned property name is not in
 * the set of reserved properties as defined by {@link #reservedPropNames}.     
 *  
 * @param fieldName 
 * @return 
 */
private String getAsFieldName(String fieldName) {
  // If there's a second character, and it is uppercase, then the
  // bean property name will have a capitalized first character
  // (because setURL() maps to a property named "URL", not "uRL")
  if ((fieldName.length() > 1)
      && Character.isUpperCase(fieldName.charAt(1))) {
    fieldName = Utils.capitalizeFirstChar(fieldName);
  }
  // Make sure the property name is not reserved.
  return JavaUtils.getUniqueValue(reservedPropNames, fieldName);
}

代码示例来源:origin: org.apache.axis/com.springsource.org.apache.axis

/**
 * Utility function to get the bean property name (as will be returned
 * by the Introspector) for a given field name.  This just means
 * we capitalize the first character if the second character is
 * capitalized.  Example: a field named "fOO" will turn into
 * getter/setter methods "getFOO()/setFOO()".  So when the Introspector
 * looks at that bean, the property name will be "FOO", not "fOO" due
 * to the rules in the JavaBeans spec.  So this makes sure the
 * metadata will match. <p>
 *
 * The method also makes sure that the returned property name is not in
 * the set of reserved properties as defined by {@link #reservedPropNames}.     
 *  
 * @param fieldName 
 * @return 
 */
private String getAsFieldName(String fieldName) {
  // If there's a second character, and it is uppercase, then the
  // bean property name will have a capitalized first character
  // (because setURL() maps to a property named "URL", not "uRL")
  if ((fieldName.length() > 1)
      && Character.isUpperCase(fieldName.charAt(1))) {
    fieldName = Utils.capitalizeFirstChar(fieldName);
  }
  // Make sure the property name is not reserved.
  return JavaUtils.getUniqueValue(reservedPropNames, fieldName);
}

代码示例来源:origin: axis/axis

|| variableType.equals("byte")) {
  pw.println("        _hashCode += " + get
      + Utils.capitalizeFirstChar(variable) + "();");
} else if (variableType.equals("boolean")) {
  pw.println("        _hashCode += (" + get
      + Utils.capitalizeFirstChar(variable)
      + "() ? Boolean.TRUE : Boolean.FALSE).hashCode();");
} else if (variableType.equals("long")) {
  pw.println("        _hashCode += new Long(" + get
      + Utils.capitalizeFirstChar(variable)
      + "()).hashCode();");
} else if (variableType.equals("float")) {
  pw.println("        _hashCode += new Float(" + get
      + Utils.capitalizeFirstChar(variable)
      + "()).hashCode();");
} else if (variableType.equals("double")) {
  pw.println("        _hashCode += new Double(" + get
      + Utils.capitalizeFirstChar(variable)
      + "()).hashCode();");
} else if (variableType.indexOf("[") >= 0) {
      + Utils.capitalizeFirstChar(variable)
      + "() != null) {");
  pw.println("            for (int i=0;");
  pw.println(
      "                 i<java.lang.reflect.Array.getLength("
      + get + Utils.capitalizeFirstChar(variable) + "());");
  pw.println("                 i++) {");
  pw.println(

代码示例来源:origin: org.apache.axis/axis

|| variableType.equals("byte")) {
  pw.println("        _hashCode += " + get
      + Utils.capitalizeFirstChar(variable) + "();");
} else if (variableType.equals("boolean")) {
  pw.println("        _hashCode += (" + get
      + Utils.capitalizeFirstChar(variable)
      + "() ? Boolean.TRUE : Boolean.FALSE).hashCode();");
} else if (variableType.equals("long")) {
  pw.println("        _hashCode += new Long(" + get
      + Utils.capitalizeFirstChar(variable)
      + "()).hashCode();");
} else if (variableType.equals("float")) {
  pw.println("        _hashCode += new Float(" + get
      + Utils.capitalizeFirstChar(variable)
      + "()).hashCode();");
} else if (variableType.equals("double")) {
  pw.println("        _hashCode += new Double(" + get
      + Utils.capitalizeFirstChar(variable)
      + "()).hashCode();");
} else if (variableType.indexOf("[") >= 0) {
      + Utils.capitalizeFirstChar(variable)
      + "() != null) {");
  pw.println("            for (int i=0;");
  pw.println(
      "                 i<java.lang.reflect.Array.getLength("
      + get + Utils.capitalizeFirstChar(variable) + "());");
  pw.println("                 i++) {");
  pw.println(

代码示例来源:origin: org.apache.axis/com.springsource.org.apache.axis

|| variableType.equals("byte")) {
  pw.println("        _hashCode += " + get
      + Utils.capitalizeFirstChar(variable) + "();");
} else if (variableType.equals("boolean")) {
  pw.println("        _hashCode += (" + get
      + Utils.capitalizeFirstChar(variable)
      + "() ? Boolean.TRUE : Boolean.FALSE).hashCode();");
} else if (variableType.equals("long")) {
  pw.println("        _hashCode += new Long(" + get
      + Utils.capitalizeFirstChar(variable)
      + "()).hashCode();");
} else if (variableType.equals("float")) {
  pw.println("        _hashCode += new Float(" + get
      + Utils.capitalizeFirstChar(variable)
      + "()).hashCode();");
} else if (variableType.equals("double")) {
  pw.println("        _hashCode += new Double(" + get
      + Utils.capitalizeFirstChar(variable)
      + "()).hashCode();");
} else if (variableType.indexOf("[") >= 0) {
      + Utils.capitalizeFirstChar(variable)
      + "() != null) {");
  pw.println("            for (int i=0;");
  pw.println(
      "                 i<java.lang.reflect.Array.getLength("
      + get + Utils.capitalizeFirstChar(variable) + "());");
  pw.println("                 i++) {");
  pw.println(

代码示例来源:origin: org.apache.axis/axis

|| variableType.equals("byte")) {
  pw.print("            this." + variable + " == other."
      + get + Utils.capitalizeFirstChar(variable)
      + "()");
} else if (variableType.indexOf("[") >= 0) {
      + Utils.capitalizeFirstChar(variable)
      + "()==null) || ");
  pw.println("             (this." + variable + "!=null &&");
  pw.print("              java.util.Arrays.equals(this."
      + variable + ", other." + get
      + Utils.capitalizeFirstChar(variable) + "())))");
} else {
  pw.println("            ((this." + variable
      + "==null && other." + get
      + Utils.capitalizeFirstChar(variable)
      + "()==null) || ");
  pw.println("             (this." + variable + "!=null &&");
  pw.print("              this." + variable
      + ".equals(other." + get
      + Utils.capitalizeFirstChar(variable) + "())))");

代码示例来源:origin: org.apache.axis/com.springsource.org.apache.axis

|| variableType.equals("byte")) {
  pw.print("            this." + variable + " == other."
      + get + Utils.capitalizeFirstChar(variable)
      + "()");
} else if (variableType.indexOf("[") >= 0) {
      + Utils.capitalizeFirstChar(variable)
      + "()==null) || ");
  pw.println("             (this." + variable + "!=null &&");
  pw.print("              java.util.Arrays.equals(this."
      + variable + ", other." + get
      + Utils.capitalizeFirstChar(variable) + "())))");
} else {
  pw.println("            ((this." + variable
      + "==null && other." + get
      + Utils.capitalizeFirstChar(variable)
      + "()==null) || ");
  pw.println("             (this." + variable + "!=null &&");
  pw.print("              this." + variable
      + ".equals(other." + get
      + Utils.capitalizeFirstChar(variable) + "())))");

代码示例来源:origin: axis/axis

|| variableType.equals("byte")) {
  pw.print("            this." + variable + " == other."
      + get + Utils.capitalizeFirstChar(variable)
      + "()");
} else if (variableType.indexOf("[") >= 0) {
      + Utils.capitalizeFirstChar(variable)
      + "()==null) || ");
  pw.println("             (this." + variable + "!=null &&");
  pw.print("              java.util.Arrays.equals(this."
      + variable + ", other." + get
      + Utils.capitalizeFirstChar(variable) + "())))");
} else {
  pw.println("            ((this." + variable
      + "==null && other." + get
      + Utils.capitalizeFirstChar(variable)
      + "()==null) || ");
  pw.println("             (this." + variable + "!=null &&");
  pw.print("              this." + variable
      + ".equals(other." + get
      + Utils.capitalizeFirstChar(variable) + "())))");

代码示例来源:origin: org.apache.axis/axis

capName = Utils.capitalizeFirstChar(name);

代码示例来源:origin: axis/axis

capName = Utils.capitalizeFirstChar(name);

代码示例来源:origin: org.apache.axis/com.springsource.org.apache.axis

+ Utils.capitalizeFirstChar(variable) + "() {");
pw.println("        return this." + variable + ";");
pw.println("    }");

代码示例来源:origin: org.apache.axis/com.springsource.org.apache.axis

capName = Utils.capitalizeFirstChar(name);

代码示例来源:origin: org.apache.axis/axis

+ Utils.capitalizeFirstChar(variable) + "() {");
pw.println("        return this." + variable + ";");
pw.println("    }");

代码示例来源:origin: axis/axis

+ Utils.capitalizeFirstChar(variable) + "() {");
pw.println("        return this." + variable + ";");
pw.println("    }");

代码示例来源:origin: org.apache.axis/axis

String typeName = (String) names.get(i);
String name = (String) names.get(i + 1);
String capName = Utils.capitalizeFirstChar(name);

代码示例来源:origin: axis/axis

name = capitalizeFirstChar(name);
  || typeValue.equals("double") || typeValue.equals("boolean")
  || typeValue.equals("byte")) {
return "javax.xml.rpc.holders." + capitalizeFirstChar(typeValue)
    + "Holder";

相关文章

微信公众号

最新文章

更多