use of java.text.StringCharacterIterator in project intellij-community by JetBrains.
the class StubBuildingVisitor method parseClassSignature.
private ClassInfo parseClassSignature(String signature) throws ClsFormatException {
ClassInfo result = new ClassInfo();
CharacterIterator iterator = new StringCharacterIterator(signature);
result.typeParameters = SignatureParsing.parseTypeParametersDeclaration(iterator, myMapping);
result.superName = SignatureParsing.parseTopLevelClassRefSignature(iterator, myMapping);
while (iterator.current() != CharacterIterator.DONE) {
String name = SignatureParsing.parseTopLevelClassRefSignature(iterator, myMapping);
if (name == null)
throw new ClsFormatException();
if (result.interfaceNames == null)
result.interfaceNames = ContainerUtil.newSmartList();
result.interfaceNames.add(name);
}
return result;
}
use of java.text.StringCharacterIterator in project Gradle-demo by Arisono.
the class JsonValidator method literal.
private boolean literal(String text) {
CharacterIterator ci = new StringCharacterIterator(text);
char t = ci.first();
if (c != t)
return false;
int start = col;
boolean ret = true;
for (t = ci.next(); t != CharacterIterator.DONE; t = ci.next()) {
if (t != nextCharacter()) {
ret = false;
break;
}
}
nextCharacter();
if (!ret)
error("literal " + text, start);
return ret;
}
use of java.text.StringCharacterIterator in project Gradle-demo by Arisono.
the class MainUtils method test09.
private static void test09() {
char y = '"';
boolean b = y == '"';
System.out.println(b);
String str = "\"";
new StringCharacterIterator(str).first();
}
use of java.text.StringCharacterIterator in project OpenAM by OpenRock.
the class SAMLUtils method displayXML.
/**
* Displays an XML string.
* This is a utility function used to hack up an HTML display of an XML
* string.
* @param input original string
* @return encoded string so it can be displayed properly by html.
*/
public static String displayXML(String input) {
debug.message("In displayXML ");
StringCharacterIterator iter = new StringCharacterIterator(input);
StringBuffer buf = new StringBuffer();
for (char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) {
if (c == '>') {
buf.append(">");
} else if (c == '<') {
buf.append("<");
} else if (c == '\n') {
buf.append("<BR>\n");
} else {
buf.append(c);
}
}
return buf.toString();
}
use of java.text.StringCharacterIterator in project intellij-community by JetBrains.
the class RestTitle method getName.
@Nullable
public String getName() {
final String text = getNode().getText().trim();
if (text.length() < 2)
return null;
final char adorn = text.charAt(text.length() - 2);
final CharacterIterator it = new StringCharacterIterator(text);
int finish = 0;
for (char ch = it.last(); ch != CharacterIterator.DONE; ch = it.previous()) {
if (ch != adorn) {
finish = it.getIndex();
break;
}
}
int start = 0;
if (text.charAt(0) == adorn) {
for (char ch = it.first(); ch != CharacterIterator.DONE; ch = it.next()) {
if (ch != adorn) {
start = it.getIndex() + 1;
break;
}
}
}
if (finish <= 0 || start < 0)
return null;
return text.substring(start, finish).trim();
}
Aggregations