/** * Gets the substring before the first occurrence given char. * * @param c * char to scan for * @return the substring */ public final String beforeFirst(final char c) { return Strings.beforeFirst(text, c); }
/** * Gets the substring before the first occurrence given char. * * @param c * char to scan for * @return the substring */ public final String beforeFirst(final char c) { return Strings.beforeFirst(text, c); }
/** * Gets the substring before the first occurrence given char. * * @param c * char to scan for * @return the substring */ public final String beforeFirst(final char c) { return Strings.beforeFirst(text, c); }
/** * Cleans the class name from any extra information that may be there. * * @param className * The raw class name parsed from the url * @return The cleaned class name */ protected String cleanClassName(String className) { Args.notEmpty(className, "className"); if (Strings.indexOf(className, ';') > -1) { // remove any path parameters set manually by the user. WICKET-5500 className = Strings.beforeFirst(className, ';'); } return className; }
/** * Cleans the class name from any extra information that may be there. * * @param className * The raw class name parsed from the url * @return The cleaned class name */ protected String cleanClassName(String className) { Args.notEmpty(className, "className"); if (Strings.indexOf(className, ';') > -1) { // remove any path parameters set manually by the user. WICKET-5500 className = Strings.beforeFirst(className, ';'); } return className; }
url = Strings.beforeFirst(url, '?');
/** * Transform name to {@link ORule.ResourceGeneric} * @param name name to transform * @return {@link ORule.ResourceGeneric} or null */ public static ORule.ResourceGeneric getResourceGeneric(String name) { String shortName = Strings.beforeFirst(name, '.'); if(Strings.isEmpty(shortName)) shortName = name; ORule.ResourceGeneric value = ORule.ResourceGeneric.valueOf(shortName); if(value==null) value = ORule.mapLegacyResourceToGenericResource(name); return value; }
url = Strings.beforeFirst(url, '?');
url = Strings.beforeFirst(url, '?');
/** * Transform name to {@link ORule.ResourceGeneric} * @param name name to transform * @return {@link ORule.ResourceGeneric} or null */ public static ORule.ResourceGeneric getResourceGeneric(String name) { String shortName = Strings.beforeFirst(name, '.'); if(Strings.isEmpty(shortName)) shortName = name; ORule.ResourceGeneric value = ORule.ResourceGeneric.valueOf(shortName); if(value==null) value = ORule.mapLegacyResourceToGenericResource(name); return value; }
@Override protected OProperty doBackward(String b) { ODatabaseDocument db = OrientDbWebSession.get().getDatabase(); OSchema schema = db.getMetadata().getSchema(); String className = Strings.beforeFirst(b, '.'); String propertyName = Strings.afterFirst(b, '.'); OClass oClass = schema.getClass(className); return oClass.getProperty(propertyName); }
@Override protected OProperty doBackward(String b) { ODatabaseDocument db = OrientDbWebSession.get().getDatabase(); OSchema schema = db.getMetadata().getSchema(); String className = Strings.beforeFirst(b, '.'); String propertyName = Strings.afterFirst(b, '.'); OClass oClass = schema.getClass(className); return oClass.getProperty(propertyName); }