/** * Creates a key from the specified string. The string is either a regular * attribute name or an attribute name starting with '@' and an annotation * prefix. * * @param name * @return */ public static Key createKey(String name) { if (!isAnnotated(name)) { return new Key(null, name); } int idx = name.indexOf(":"); if (idx > 0 && name.length() > idx) { return new Key(name.substring(1, idx), name.substring(idx + 1)); } else { return new Key(name.substring(1), name.substring(1)); } }
/** * Creates a key from the specified string. The string is either a regular * attribute name or an attribute name starting with '@' and an annotation * prefix. * * @param name * @return */ public static Key createKey(String name) { if (!isAnnotated(name)) { return new Key(null, name); } int idx = name.indexOf(":"); if (idx > 0 && name.length() > idx) { return new Key(name.substring(1, idx), name.substring(idx + 1)); } else { return new Key(name.substring(1), name.substring(1)); } }
/** * Creates a new key from the specified annotation and the given name. * * @param annotation * @param name * @return */ public static Key createKey(String annotation, String name) { return new Key(annotation, name); }
/** * Creates a new key from the specified annotation and the given name. * * @param annotation * @param name * @return */ public static Key createKey(String annotation, String name) { return new Key(annotation, name); }