當前位置: 首頁>>代碼示例>>Java>>正文


Java StringUtils.substringAfter方法代碼示例

本文整理匯總了Java中org.apache.commons.lang3.StringUtils.substringAfter方法的典型用法代碼示例。如果您正苦於以下問題:Java StringUtils.substringAfter方法的具體用法?Java StringUtils.substringAfter怎麽用?Java StringUtils.substringAfter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.commons.lang3.StringUtils的用法示例。


在下文中一共展示了StringUtils.substringAfter方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: generateMapType

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
private static Object generateMapType(ServiceDefinition def, TypeDefinition td, MetadataType metadataType,
                                      Set<String> resolvedTypes) {
    String keyType = StringUtils.substringAfter(td.getType(), "<");
    keyType = StringUtils.substringBefore(keyType, ",");
    keyType = StringUtils.strip(keyType);
    keyType = StringUtils.isNotEmpty(keyType) ? keyType : "java.lang.Object";
    Object key = generateType(def, keyType, metadataType, resolvedTypes);

    String valueType = StringUtils.substringAfter(td.getType(), ",");
    valueType = StringUtils.substringBefore(valueType, ">");
    valueType = StringUtils.strip(valueType);
    valueType = StringUtils.isNotEmpty(valueType) ? valueType : "java.lang.Object";
    Object value = generateType(def, valueType, metadataType, resolvedTypes);

    Map<Object, Object> map = new HashMap<>();
    map.put(key, value);
    return map;
}
 
開發者ID:venus-boot,項目名稱:saluki,代碼行數:19,代碼來源:GenericInvokeUtils.java

示例2: handle

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
@Override
public void handle(MessageReceivedEvent event) {
	String message = event.getMessage().getContent();
	String channel = event.getChannel().getName();
	LOGGER.info("Read : {} in channel {}",message,channel);
	
	if(message.startsWith(COMMAND_CUE)) {
		String commandString = StringUtils.substringAfter(message, COMMAND_CUE);
		
		String[] args    = commandString.split(" ");
		Command  command = library.getCommand(args[0]);
		
		if(command == null || !command.handle(event, args)) {
			event.getChannel().sendMessage("Sorry!!, I did not understand your message " + commandString + ":(. Type !help for list of commands");
		}
	}
}
 
開發者ID:cool-mist,項目名稱:DiscordConvenienceBot,代碼行數:18,代碼來源:CommandListener.java

示例3: getProject

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
@Sessional
protected ProjectFacade getProject(HttpServletRequest request, HttpServletResponse response, String projectInfo) 
		throws IOException {
	projectInfo = StringUtils.stripStart(StringUtils.stripEnd(projectInfo, "/"), "/");

	if (StringUtils.isBlank(projectInfo) || !projectInfo.startsWith("projects/")) {
		String url = request.getRequestURL().toString();
		String urlRoot = url.substring(0, url.length()-getPathInfo(request).length());
		throw new GitException(String.format("Expecting url of format %sprojects/<project name>", urlRoot));
	} 
	
	String projectName = StringUtils.substringAfter(projectInfo, "/");
	
	if (projectName.endsWith(".git"))
		projectName = projectName.substring(0, projectName.length()-".git".length());
	
	Project project = projectManager.find(projectName);
	if (project == null) {
		throw new GitException(String.format("Unable to find project %s", projectName));
	}
	
	return project.getFacade();
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:24,代碼來源:GitFilter.java

示例4: fromTransportFormatToBytes

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
/**
    * Transform a byte [] transported in hex prefixed by "**!kawanfw_bytes!**"
    * to it's orginal byte []
    * 
    * @param string
    *            the string that contains the bytes prefixed by
    *            "**!kawanfw_bytes!**"
    * @return the bytes
    */
   public static byte[] fromTransportFormatToBytes(String string) {
String encodedString = StringUtils
	.substringAfter(string, KAWANFW_BYTES);

if (encodedString.equals("null")) {
    return null;
}

try {
    byte[] bytes = Base64.base64ToByteArray(encodedString);
    return bytes;
} catch (Exception e) {
    throw new IllegalArgumentException(Tag.PRODUCT_PRODUCT_FAIL
	    + "String is not in BASE64 format: " + encodedString, e);
}

   }
 
開發者ID:kawansoft,項目名稱:aceql-http,代碼行數:27,代碼來源:TransportConverter.java

示例5: constructPatternId

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
public static String constructPatternId(String patternResourcePath, String patternsPath, String templateName, String jsonDataFileName) {
    final String patternPath = StringUtils.substringAfter(patternResourcePath, patternsPath + SLASH);
    final StringBuilder patternIdBuilder = new StringBuilder();
    if (StringUtils.endsWith(patternPath, HTML_EXT)) {
        patternIdBuilder.append(StringUtils.substringBeforeLast(patternPath, HTML_EXT));
    } else {
        patternIdBuilder.append(patternPath);
    }
    if (StringUtils.isNotBlank(templateName)) {
        patternIdBuilder.append(SLASH).append(templateName);
    }
    if (StringUtils.isNotBlank(jsonDataFileName)) {
        final String patternFileName = StringUtils.substringAfterLast(patternPath, SLASH);
        final String fileNameWithoutExt = StringUtils.substringBeforeLast(patternFileName, HTML_EXT);
        final String dataFileSuffix = StringUtils.substringBetween(jsonDataFileName, fileNameWithoutExt
                + SELECTOR, DATA_EXT);
        patternIdBuilder.append(SLASH).append(StringUtils.defaultString(dataFileSuffix, fileNameWithoutExt));
    }
    return StringUtils.replace(patternIdBuilder.toString(), SLASH, PATTERN_ID_REPLACEMENT);
}
 
開發者ID:deepthinkit,項目名稱:patternlab-for-sling,代碼行數:21,代碼來源:PatternLabUtils.java

示例6: TextRange

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
public TextRange(String markStr) {
	String begin = StringUtils.substringBefore(markStr, "-");
	String end = StringUtils.substringAfter(markStr, "-");
	beginLine = Integer.parseInt(StringUtils.substringBefore(begin, "."))-1;
	beginChar = Integer.parseInt(StringUtils.substringAfter(begin, "."));
	endLine = Integer.parseInt(StringUtils.substringBefore(end, "."))-1;
	endChar = Integer.parseInt(StringUtils.substringAfter(end, "."));
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:9,代碼來源:TextRange.java

示例7: fromPath

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
private static Registration fromPath(String path) {
	String subPath = StringUtils.substringAfter(path, basePath);
	String[] array = subPath.split("/");
	String serviceName = array[0];
	String[] address = array[1].split(":");
	Registration registration = new Registration(address[0], Integer.parseInt(address[1]), serviceName);
	return registration;
}
 
開發者ID:DanceFirstThinkLater,項目名稱:PetiteRPC,代碼行數:9,代碼來源:ZookeeperRegistry.java

示例8: getClassName

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
public static String getClassName(String code) {
    String className = StringUtils.substringBefore(code, "{");
    if (StringUtils.isBlank(className)) {
        return className;
    }
    if (StringUtils.contains(code, " class ")) {
        className = StringUtils.substringAfter(className, " class ");
        if (StringUtils.contains(className, " extends ")) {
            className = StringUtils.substringBefore(className, " extends ").trim();
        } else if (StringUtils.contains(className, " implements ")) {
            className = StringUtils.trim(StringUtils.substringBefore(className, " implements "));
        } else {
            className = StringUtils.trim(className);
        }
    } else if (StringUtils.contains(code, " interface ")) {
        className = StringUtils.substringAfter(className, " interface ");
        if (StringUtils.contains(className, " extends ")) {
            className = StringUtils.substringBefore(className, " extends ").trim();
        } else {
            className = StringUtils.trim(className);
        }
    } else if (StringUtils.contains(code, " enum ")) {
        className = StringUtils.trim(StringUtils.substringAfter(className, " enum "));
    } else {
        return StringUtils.EMPTY;
    }
    return className;
}
 
開發者ID:lyy4j,項目名稱:rmq4note,代碼行數:29,代碼來源:DynaCode.java

示例9: fromSqlToJava

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
/**
    * Decode the String param type passed by user on client side into a Types
    * corresponding value.
    * 
    * @param sqlParamType
    * @return
    */
   public static int fromSqlToJava(String sqlParamType) {
int javaType = 0;

if (sqlParamType.equals(AceQLTypes.CHARACTER)) {
    javaType = Types.CHAR;
} else if (sqlParamType.equals(AceQLTypes.VARCHAR)) {
    javaType = Types.VARCHAR;
} else if (sqlParamType.equals(AceQLTypes.LONGVARCHAR)) {
    javaType = Types.LONGVARCHAR;
} else if (sqlParamType.equals(AceQLTypes.BIT)) {
    javaType = Types.BIT;
} else if (sqlParamType.equals(AceQLTypes.NUMERIC)) {
    javaType = Types.NUMERIC;
} else if (sqlParamType.equals(AceQLTypes.TINYINT)) {
    javaType = Types.TINYINT;
} else if (sqlParamType.equals(AceQLTypes.SMALLINT)) {
    javaType = Types.SMALLINT;
} else if (sqlParamType.equals(AceQLTypes.INTEGER)) {
    javaType = Types.INTEGER;
} else if (sqlParamType.equals(AceQLTypes.BIGINT)) {
    javaType = Types.BIGINT;
} else if (sqlParamType.equals(AceQLTypes.REAL)) {
    javaType = Types.REAL;
} else if (sqlParamType.equals(AceQLTypes.FLOAT)) {
    javaType = Types.FLOAT;
} else if (sqlParamType.equals(AceQLTypes.DOUBLE_PRECISION)) {
    javaType = Types.DOUBLE;
} else if (sqlParamType.equals(AceQLTypes.DATE)) {
    javaType = Types.DATE;
} else if (sqlParamType.equals(AceQLTypes.TIME)) {
    javaType = Types.TIME;
} else if (sqlParamType.equals(AceQLTypes.TIMESTAMP)) {
    javaType = Types.TIMESTAMP;
} else if (sqlParamType.equals(AceQLTypes.BINARY)) {
    javaType = Types.BINARY;
} else if (sqlParamType.equals(AceQLTypes.VARBINARY)) {
    javaType = Types.VARBINARY;
} else if (sqlParamType.equals(AceQLTypes.DATE)) {
    javaType = Types.LONGVARBINARY;
} else if (sqlParamType.equals(AceQLTypes.BLOB)) {
    javaType = Types.BLOB;
} else if (sqlParamType.equals(AceQLTypes.CLOB)) {
    javaType = Types.CLOB;
} else if (sqlParamType.startsWith("TYPE_NULL")) {
    String javaTypeStr = StringUtils.substringAfter(sqlParamType,
	    "TYPE_NULL");
    javaType = Integer.parseInt(javaTypeStr);
} else {
    throw new IllegalArgumentException(
	    "Unsuported data type for null setting: " + sqlParamType);
}
return javaType;
   }
 
開發者ID:kawansoft,項目名稱:aceql-http,代碼行數:61,代碼來源:JavaSqlConversion.java

示例10: asFile

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
/**
 * 兼容無前綴, classpath://, file:// 的情況獲取文件
 * 
 * 如果以classpath:// 定義的文件不存在會拋出IllegalArgumentException異常,以file://定義的則不會
 */
public static File asFile(String generalPath) throws IOException {
	if (StringUtils.startsWith(generalPath, CLASSPATH_PREFIX)) {
		String resourceName = StringUtils.substringAfter(generalPath, CLASSPATH_PREFIX);
		return getFileByURL(ResourceUtil.asUrl(resourceName));
	}
	try {
		// try URL
		return getFileByURL(new URL(generalPath));
	} catch (MalformedURLException ex) {
		// no URL -> treat as file path
		return new File(generalPath);
	}
}
 
開發者ID:zhangjunfang,項目名稱:util,代碼行數:19,代碼來源:URLResourceUtil.java

示例11: setConnectorValues

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
/**
 * If there are some Connector properties, set them on Tomcat instance
 */
public void setConnectorValues() {

	// Do we have to set special values to the Connector?
	Enumeration<?> enumeration = properties.propertyNames();

	if (enumeration.hasMoreElements()) {
		System.out.println(SqlTag.SQL_PRODUCT_START + " Setting Default Connector base attributes:");
	}

	while (enumeration.hasMoreElements()) {
		String property = (String) enumeration.nextElement();

		if (property.startsWith("connector.")) {

			String theValue = properties.getProperty(property);
			String tomcatProperty = StringUtils.substringAfter(property, "connector.");

			if (theValue != null && !theValue.isEmpty()) {

				theValue = theValue.trim();

				System.out.println(SqlTag.SQL_PRODUCT_START + "  -> " + tomcatProperty + " = " + theValue);

				tomcat.getConnector().setProperty(tomcatProperty, theValue);
			}
		}
	}
}
 
開發者ID:kawansoft,項目名稱:aceql-http,代碼行數:32,代碼來源:TomcatConnectorsUpdater.java

示例12: getUrlHttpOnly

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
/**
    * Returns the HTTP URL
    * 
    * @param url
    *            the JDBC URL with maybe "jdbc:aceql:" header
    * @return the pure HTTP URL
    */
   public static String getUrlHttpOnly(String url) {

if (url == null) {
    throw new IllegalArgumentException("url is null!");
}

String urlHttpOnly = url;
if (url.startsWith(JDBC_URL_HEADER)) {
    urlHttpOnly = StringUtils.substringAfter(url, JDBC_URL_HEADER);
}
return urlHttpOnly;
   }
 
開發者ID:kawansoft,項目名稱:aceql-http,代碼行數:20,代碼來源:JdbcUrlHeader.java

示例13: asStream

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
/**
 * 兼容file://與classpath://的情況的打開文件成Stream
 */
public static InputStream asStream(String generalPath) throws IOException {
	if (StringUtils.startsWith(generalPath, CLASSPATH_PREFIX)) {
		String resourceName = StringUtils.substringAfter(generalPath, CLASSPATH_PREFIX);
		return ResourceUtil.asStream(resourceName);
	}

	try {
		// try URL
		return FileUtil.asInputStream(getFileByURL(new URL(generalPath)));
	} catch (MalformedURLException ex) {
		// no URL -> treat as file path
		return FileUtil.asInputStream(generalPath);
	}
}
 
開發者ID:zhangjunfang,項目名稱:util,代碼行數:18,代碼來源:URLResourceUtil.java

示例14: findParameterTypes

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
public static String[] findParameterTypes(String methodSignature, boolean erase) {
    String parameterStr = StringUtils.substringAfter(methodSignature, "~");
    String[] types = StringUtils.split(parameterStr, ';');
    if (erase) {
        for (int i = 0; i < types.length; i++) {
            types[i] = StringUtils.substringBefore(types[i], "<");
        }
    }
    return types;
}
 
開發者ID:venus-boot,項目名稱:saluki,代碼行數:11,代碼來源:GenericInvokeUtils.java

示例15: buildURL

import org.apache.commons.lang3.StringUtils; //導入方法依賴的package包/類
private GrpcURL buildURL(ConsulService service) {
  try {
    for (String tag : service.getTags()) {
      if (StringUtils.indexOf(tag, Constants.PROVIDERS_CATEGORY) != -1) {
        String toUrlPath = StringUtils.substringAfter(tag, Constants.PROVIDERS_CATEGORY);
        GrpcURL salukiUrl = GrpcURL.valueOf(GrpcURL.decode(toUrlPath));
        return salukiUrl;
      }
    }
  } catch (Exception e) {
    log.error("convert consul service to url fail! service:" + service, e);
  }
  return null;
}
 
開發者ID:venus-boot,項目名稱:saluki,代碼行數:15,代碼來源:ConsulRegistry.java


注:本文中的org.apache.commons.lang3.StringUtils.substringAfter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。