当前位置: 首页>>代码示例>>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;未经允许,请勿转载。