Java String to convertStringFormat(String property)

Here you can find the source of convertStringFormat(String property)

Description

convert String Format

License

Open Source License

Declaration

public static String convertStringFormat(String property) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2010 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:/*from w  w  w  .j a  v a  2  s .  c  om*/
 *  Actuate Corporation  - initial API and implementation
 *******************************************************************************/

public class Main {
    public static String ZIP = "@@@@@-@@@@";
    public static String PHONE = "(@@@)@@@-@@@@";
    public static String SOCIAL = "@@@-@@-@@@@";
    public static String ZIP_CODE = "00000\\-0000";
    public static String PHONE_CODE = "[<=9999999]###\\-####;\\(###\\)\\ ###\\-####";
    public static String SOCIALNUMBER_CODE = "000\\-00\\-0000";

    public static String convertStringFormat(String property) {
        if (property == null)
            return null;
        if (ZIP.equals(property))
            return ZIP_CODE;
        if (PHONE.equals(property))
            return PHONE_CODE;
        if (SOCIAL.equals(property))
            return SOCIALNUMBER_CODE;
        return property;
    }
}

Related

  1. convertString2Bytes(String str)
  2. convertString2GSonString(String str)
  3. convertStringArrayToFloatArray(String[] num)
  4. convertStringArrayToString(String[] a_asStrings, String a_sDelim)
  5. convertStringArrayToString(String[] value, String separator)
  6. convertStringsToTextSet(String[] values)
  7. convertStringToArray(String str)
  8. convertStringToColor(String color)
  9. ConvertStringToEnumValue(String enumAsString, Class type)