1 25 26 package org.objectweb.easybeans.enhancer.lib; 27 28 32 public final class MethodRenamer { 33 34 37 public static final String PREFIX = "original$EasyBeans$"; 38 39 42 private MethodRenamer() { 43 44 } 45 46 51 public static String encode(final String name) { 52 if (name == null) { 53 throw new IllegalArgumentException ("Cannot encode a null name"); 54 } 55 return PREFIX + name; 56 } 57 58 63 public static String decode(final String name) { 64 if (name == null || !name.startsWith(PREFIX)) { 65 throw new IllegalArgumentException ("Given name '" + name + " don't start with prefix " + PREFIX); 66 } 67 return name.substring(PREFIX.length()); 68 } 69 70 } 71 | Popular Tags |