diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-09-05 19:50:56 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-09-05 19:51:15 +0300 |
commit | 7d25670284b11c7c62ba25183f265227cb3dba83 (patch) | |
tree | c8e76eb70dd3cdd5cf59a99419635f2188b25c24 /server/src/org/jsoup/parser/Token.java | |
parent | 1d0c96de9595c243d88471476d21e5f248be63f7 (diff) | |
download | vaadin-framework-7d25670284b11c7c62ba25183f265227cb3dba83.tar.gz vaadin-framework-7d25670284b11c7c62ba25183f265227cb3dba83.zip |
Reformat project
Diffstat (limited to 'server/src/org/jsoup/parser/Token.java')
-rw-r--r-- | server/src/org/jsoup/parser/Token.java | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/server/src/org/jsoup/parser/Token.java b/server/src/org/jsoup/parser/Token.java index 9f4f9e250d..e465eb74e3 100644 --- a/server/src/org/jsoup/parser/Token.java +++ b/server/src/org/jsoup/parser/Token.java @@ -12,7 +12,7 @@ abstract class Token { private Token() { } - + String tokenType() { return this.getClass().getSimpleName(); } @@ -50,13 +50,16 @@ abstract class Token { private String pendingAttributeValue; boolean selfClosing = false; - Attributes attributes = new Attributes(); // todo: allow nodes to not have attributes + Attributes attributes = new Attributes(); // todo: allow nodes to not + // have attributes void newAttribute() { if (pendingAttributeName != null) { - if (pendingAttributeValue == null) + if (pendingAttributeValue == null) { pendingAttributeValue = ""; - Attribute attribute = new Attribute(pendingAttributeName, pendingAttributeValue); + } + Attribute attribute = new Attribute(pendingAttributeName, + pendingAttributeValue); attributes.put(attribute); } pendingAttributeName = null; @@ -85,12 +88,13 @@ abstract class Token { return selfClosing; } - @SuppressWarnings({"TypeMayBeWeakened"}) + @SuppressWarnings({ "TypeMayBeWeakened" }) Attributes getAttributes() { return attributes; } - // these appenders are rarely hit in not null state-- caused by null chars. + // these appenders are rarely hit in not null state-- caused by null + // chars. void appendTagName(String append) { tagName = tagName == null ? append : tagName.concat(append); } @@ -100,7 +104,8 @@ abstract class Token { } void appendAttributeName(String append) { - pendingAttributeName = pendingAttributeName == null ? append : pendingAttributeName.concat(append); + pendingAttributeName = pendingAttributeName == null ? append + : pendingAttributeName.concat(append); } void appendAttributeName(char append) { @@ -108,7 +113,8 @@ abstract class Token { } void appendAttributeValue(String append) { - pendingAttributeValue = pendingAttributeValue == null ? append : pendingAttributeValue.concat(append); + pendingAttributeValue = pendingAttributeValue == null ? append + : pendingAttributeValue.concat(append); } void appendAttributeValue(char append) { @@ -124,12 +130,12 @@ abstract class Token { StartTag(String name) { this(); - this.tagName = name; + tagName = name; } StartTag(String name, Attributes attributes) { this(); - this.tagName = name; + tagName = name; this.attributes = attributes; } @@ -139,7 +145,7 @@ abstract class Token { } } - static class EndTag extends Tag{ + static class EndTag extends Tag { EndTag() { super(); type = TokenType.EndTag; @@ -147,7 +153,7 @@ abstract class Token { EndTag(String name) { this(); - this.tagName = name; + tagName = name; } @Override @@ -242,11 +248,6 @@ abstract class Token { } enum TokenType { - Doctype, - StartTag, - EndTag, - Comment, - Character, - EOF + Doctype, StartTag, EndTag, Comment, Character, EOF } } |