Java Code Examples for org.apache.commons.lang.StringUtils.replaceEachRepeatedly()

The following are Jave code examples for showing how to use replaceEachRepeatedly() of the org.apache.commons.lang.StringUtils class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Hydrograph   File: ClassDetails.java   View Source Code Vote up 5 votes
private String getJavaDoc(IClassFile classFile) throws JavaModelException {
	BinaryType binaryType=(BinaryType)classFile.getType();
	if(binaryType.getSource() !=null && binaryType.getJavadocRange()!=null){
	String javaDoc=Constants.EMPTY_STRING;
		javaDoc = StringUtils.substring(binaryType.getSource().toString(), 0, binaryType.getJavadocRange().getLength());
	javaDoc = StringUtils.replaceEachRepeatedly(javaDoc, new String[] { "/*", "*/", "*" }, new String[] {
			Constants.EMPTY_STRING, Constants.EMPTY_STRING, Constants.EMPTY_STRING });
	}
	return javaDoc;
}
 
Example 2
Project: Hydrograph   File: ClassDetails.java   View Source Code Vote up 5 votes
private String getJavaDoc(SourceType javaClassFile) throws JavaModelException {
	StringBuffer source = new StringBuffer(javaClassFile.getSource());
	try {
		String javaDoc = StringUtils.substring(source.toString(), 0, javaClassFile.getJavadocRange().getLength());
		javaDoc = StringUtils.replaceEachRepeatedly(javaDoc, new String[] { "/*", "*/", "*" },
				new String[] { Constants.EMPTY_STRING, Constants.EMPTY_STRING, Constants.EMPTY_STRING });
	} catch (Exception exception) {
		LOGGER.warn("Failed to build java-doc for :{}", javaClassFile);
	}
	return javaDoc;
}
 
Example 3
Project: Hydrograph   File: MethodDetails.java   View Source Code Vote up 5 votes
private String createFormattedJavaDoc(IMethod iMethod) throws JavaModelException {
	String source = iMethod.getSource();
	if (iMethod.getJavadocRange() != null) {
		javaDoc = StringUtils.substring(source, 0, iMethod.getJavadocRange().getLength());
		javaDoc = StringUtils.replaceEachRepeatedly(javaDoc, new String[] { "/*", "*/", "*" }, new String[] {
				Constants.EMPTY_STRING, Constants.EMPTY_STRING, Constants.EMPTY_STRING });
	}
	return javaDoc;
}