Java Doc for Attribute.java in  » HTML-Parser » jericho-html » au » id » jericho » lib » html » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » HTML Parser » jericho html » au.id.jericho.lib.html 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   au.id.jericho.lib.html.Segment
      au.id.jericho.lib.html.Attribute

Attribute
final public class Attribute extends Segment (Code)
Represents a single attribute name/value segment within a StartTag .

An instance of this class is a representation of a single attribute in the source document and is not modifiable. The OutputDocument.replace(AttributesMap) and OutputDocument#replace(Attributes, boolean convertNamesToLowerCase) methods provide the means to add, delete or modify attributes and their values in an OutputDocument .

Obtained using the Attributes.get(String key) method.

See also the XML 1.0 specification for attributes.
See Also:   Attributes



Field Summary
final static  StringCHECKED
    
final static  StringCLASS
    
final static  StringDISABLED
    
final static  StringID
    
final static  StringMULTIPLE
    
final static  StringNAME
    
final static  StringSELECTED
    
final static  StringSTYLE
    
final static  StringTYPE
    
final static  StringVALUE
    

Constructor Summary
 Attribute(Source source, String key, Segment nameSegment)
     Constructs a new Attribute with no value part, called from Attributes class.
 Attribute(Source source, String key, Segment nameSegment, Segment valueSegment, Segment valueSegmentIncludingQuotes)
     Constructs a new Attribute, called from Attributes class.

The resulting Attribute segment begins at the start of the nameSegment and finishes at the end of the valueSegmentIncludingQuotes.


Method Summary
static  StringBufferappendHTML(StringBuffer sb, CharSequence name, CharSequence value)
    
static  WriterappendHTML(Writer writer, CharSequence name, CharSequence value)
    
 TagappendTidy(StringBuffer sb, Tag nextTag)
    
public  StringgetDebugInfo()
     Returns a string representation of this object useful for debugging purposes.
public  StringgetKey()
     Returns the name of this attribute in lower case.
public  StringgetName()
     Returns the name of this attribute in original case.
public  SegmentgetNameSegment()
     Returns the segment spanning the of this attribute.
public  chargetQuoteChar()
     Returns the character used to quote the value.
public  StringgetValue()
     Returns the value of this attribute, or null if it .
public  SegmentgetValueSegment()
     Returns the segment spanning the of this attribute, or null if it .
public  SegmentgetValueSegmentIncludingQuotes()
     Returns the segment spanning the of this attribute, including quotation marks if any, or null if it .
public  booleanhasValue()
     Indicates whether this attribute has a value.

Field Detail
CHECKED
final static String CHECKED(Code)



CLASS
final static String CLASS(Code)



DISABLED
final static String DISABLED(Code)



ID
final static String ID(Code)



MULTIPLE
final static String MULTIPLE(Code)



NAME
final static String NAME(Code)



SELECTED
final static String SELECTED(Code)



STYLE
final static String STYLE(Code)



TYPE
final static String TYPE(Code)



VALUE
final static String VALUE(Code)




Constructor Detail
Attribute
Attribute(Source source, String key, Segment nameSegment)(Code)
Constructs a new Attribute with no value part, called from Attributes class.

Note that the resulting Attribute segment has the same span as the supplied nameSegment.
Parameters:
  source - the Source document.
Parameters:
  key - the name of this attribute in lower case.
Parameters:
  nameSegment - the segment representing the name.




Attribute
Attribute(Source source, String key, Segment nameSegment, Segment valueSegment, Segment valueSegmentIncludingQuotes)(Code)
Constructs a new Attribute, called from Attributes class.

The resulting Attribute segment begins at the start of the nameSegment and finishes at the end of the valueSegmentIncludingQuotes. If this attribute has no value, it finishes at the end of the nameSegment.

If this attribute has no value, the valueSegment and valueSegmentIncludingQuotes must be null. The parameter must not be null if the valueSegment is not null, and vice versa
Parameters:
  source - the Source document.
Parameters:
  key - the name of this attribute in lower case.
Parameters:
  nameSegment - the segment spanning the name.
Parameters:
  valueSegment - the segment spanning the value.
Parameters:
  valueSegmentIncludingQuotes - the segment spanning the value, including quotation marks if any.





Method Detail
appendHTML
static StringBuffer appendHTML(StringBuffer sb, CharSequence name, CharSequence value)(Code)



appendHTML
static Writer appendHTML(Writer writer, CharSequence name, CharSequence value) throws IOException(Code)



appendTidy
Tag appendTidy(StringBuffer sb, Tag nextTag)(Code)



getDebugInfo
public String getDebugInfo()(Code)
Returns a string representation of this object useful for debugging purposes. a string representation of this object useful for debugging purposes.



getKey
public String getKey()(Code)
Returns the name of this attribute in lower case.

This package treats all attribute names as case insensitive, consistent with HTML but not consistent with XHTML. the name of this attribute in lower case.
See Also:   Attribute.getName()




getName
public String getName()(Code)
Returns the name of this attribute in original case.

This is exactly equivalent to Attribute.getNameSegment() .toString(). the name of this attribute in original case.
See Also:   Attribute.getKey()




getNameSegment
public Segment getNameSegment()(Code)
Returns the segment spanning the of this attribute. the segment spanning the of this attribute.
See Also:   Attribute.getName()



getQuoteChar
public char getQuoteChar()(Code)
Returns the character used to quote the value.

The return value is either a double-quote ("), a single-quote ('), or a space. the character used to quote the value, or a space if the value is not quoted or this attribute has no value.




getValue
public String getValue()(Code)
Returns the value of this attribute, or null if it .

This is equivalent to CharacterReference . CharacterReference.decode(CharSequenceboolean) decode ( Attribute.getValueSegment() ,true).

Note that before version 1.4.1 this method returned the raw value of the attribute as it appears in the source document, without .

To obtain the raw value without decoding, use Attribute.getValueSegment() .toString().

Special attention should be given to attributes that contain URLs, such as the href attribute. When such an attribute contains a URL with parameters (as described in the form-urlencoded media type), the ampersand (&) characters used to separate the parameters should be to prevent the parameter names from being unintentionally interpreted as . This requirement is explicitly stated in the HTML 4.01 specification section 5.3.2.

For example, take the following element in the source document:

<a href="Report.jsp?chapt=2&sect=3">next</a>
By default, calling Element.getAttributes getAttributes() . Attributes.getValue(String) getValue ("href") on this element returns the string "Report.jsp?chapt=2§=3", since the text "&sect" is interpreted as the rarely used character entity reference CharacterEntityReference._sect &sect; (U+00A7), despite the fact that it is missing the (;).

Most browsers recognise unterminated character entity references in attribute values representing a codepoint of U+00FF or below, but ignore those representing codepoints above this value. One relatively popular browser only recognises those representing a codepoint of U+003E or below, meaning it would have interpreted the URL in the above example differently to most other browsers. Most browsers also use different rules depending on whether the unterminated character reference is inside or outside of an attribute value, with both of these possibilities further split into different rules for , decimal character references, and hexadecimal character references.

The behaviour of this library is determined by the current setting, which is determined by the Config.CurrentCompatibilityMode property. the value of this attribute, or null if it .




getValueSegment
public Segment getValueSegment()(Code)
Returns the segment spanning the of this attribute, or null if it . the segment spanning the of this attribute, or null if it .
See Also:   Attribute.getValue()



getValueSegmentIncludingQuotes
public Segment getValueSegmentIncludingQuotes()(Code)
Returns the segment spanning the of this attribute, including quotation marks if any, or null if it .

If the value is not enclosed by quotation marks, this is the same as the the segment spanning the of this attribute, including quotation marks if any, or null if it .




hasValue
public boolean hasValue()(Code)
Indicates whether this attribute has a value.

This method also returns true if this attribute has been assigned a zero-length value.

It only returns false if this attribute appears in minimized form. true if this attribute has a value, otherwise false.




Fields inherited from au.id.jericho.lib.html.Segment
final int begin(Code)(Java Doc)
List childElements(Code)(Java Doc)
final int end(Code)(Java Doc)
final Source source(Code)(Java Doc)

Methods inherited from au.id.jericho.lib.html.Segment
final static StringBuffer appendCollapseWhiteSpace(StringBuffer sb, CharSequence text)(Code)(Java Doc)
final public char charAt(int index)(Code)(Java Doc)
public int compareTo(Object o)(Code)(Java Doc)
final public boolean encloses(Segment segment)(Code)(Java Doc)
final public boolean encloses(int pos)(Code)(Java Doc)
final public boolean equals(Object object)(Code)(Java Doc)
public String extractText()(Code)(Java Doc)
public String extractText(boolean includeAttributes)(Code)(Java Doc)
public List findAllCharacterReferences()(Code)(Java Doc)
public List findAllElements()(Code)(Java Doc)
public List findAllElements(String name)(Code)(Java Doc)
public List findAllElements(StartTagType startTagType)(Code)(Java Doc)
public List findAllElements(String attributeName, String value, boolean valueCaseSensitive)(Code)(Java Doc)
public List findAllStartTags()(Code)(Java Doc)
public List findAllStartTags(String name)(Code)(Java Doc)
public List findAllStartTags(String attributeName, String value, boolean valueCaseSensitive)(Code)(Java Doc)
public List findAllTags()(Code)(Java Doc)
public List findAllTags(TagType tagType)(Code)(Java Doc)
public List findFormControls()(Code)(Java Doc)
public FormFields findFormFields()(Code)(Java Doc)
final public int getBegin()(Code)(Java Doc)
public List getChildElements()(Code)(Java Doc)
public String getDebugInfo()(Code)(Java Doc)
final public int getEnd()(Code)(Java Doc)
public Renderer getRenderer()(Code)(Java Doc)
public TextExtractor getTextExtractor()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public void ignoreWhenParsing()(Code)(Java Doc)
final public boolean isWhiteSpace()(Code)(Java Doc)
final public static boolean isWhiteSpace(char ch)(Code)(Java Doc)
final public int length()(Code)(Java Doc)
public Attributes parseAttributes()(Code)(Java Doc)
final public CharSequence subSequence(int beginIndex, int endIndex)(Code)(Java Doc)
public String toString()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.