[hibernate-commits] Hibernate SVN: r11234 - branches/Branch_3_2/HibernateExt/commons-annotations/src/java/org/hibernate/annotations/common/util.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Fri Feb 23 16:47:34 EST 2007


Author: epbernard
Date: 2007-02-23 16:47:34 -0500 (Fri, 23 Feb 2007)
New Revision: 11234

Modified:
   branches/Branch_3_2/HibernateExt/commons-annotations/src/java/org/hibernate/annotations/common/util/StringHelper.java
Log:
left over

Modified: branches/Branch_3_2/HibernateExt/commons-annotations/src/java/org/hibernate/annotations/common/util/StringHelper.java
===================================================================
--- branches/Branch_3_2/HibernateExt/commons-annotations/src/java/org/hibernate/annotations/common/util/StringHelper.java	2007-02-23 03:45:39 UTC (rev 11233)
+++ branches/Branch_3_2/HibernateExt/commons-annotations/src/java/org/hibernate/annotations/common/util/StringHelper.java	2007-02-23 21:47:34 UTC (rev 11234)
@@ -406,4 +406,26 @@
 		return arr;
 	}
 
+	public static boolean isQuoted(String name) {
+		return name != null && name.length() != 0 && name.charAt( 0 ) == '`';
+	}
+
+	public static String quote(String name) {
+		if ( name == null || name.length() == 0 || isQuoted( name ) ) {
+			return name;
+		}
+		else {
+			return new StringBuilder( name.length() + 2 ).append('`').append( name ).append( '`' ).toString();
+		}
+	}
+
+	public static String unquote(String name) {
+		if ( isQuoted( name ) ) {
+			return name.substring( 1, name.length() - 1 );
+		}
+		else {
+			return name;
+		}
+	}
+
 }




More information about the hibernate-commits mailing list