- java.lang.Object
-
- javax.swing.text.html.HTML
-
public class HTML extends Object
Constants used in theHTMLDocument
. These are basically tag and attribute definitions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
HTML.Attribute
Typesafe enumeration representing an HTML attribute.static class
HTML.Tag
Typesafe enumeration for an HTML tag.static class
HTML.UnknownTag
-
Field Summary
Fields Modifier and Type Field and Description static String
NULL_ATTRIBUTE_VALUE
-
Constructor Summary
Constructors Constructor and Description HTML()
-
Method Summary
Methods Modifier and Type Method and Description static HTML.Attribute[]
getAllAttributeKeys()
Returns the set of HTML attributes recognized.static HTML.Tag[]
getAllTags()
Returns the set of actual HTML tags that are recognized by the default HTML reader.static HTML.Attribute
getAttributeKey(String attName)
Fetches an attribute constant for a well-known attribute name (i.e.static int
getIntegerAttributeValue(AttributeSet attr, HTML.Attribute key, int def)
Fetches an integer attribute value.static HTML.Tag
getTag(String tagName)
Fetches a tag constant for a well-known tag name (i.e.
-
-
-
Field Detail
-
NULL_ATTRIBUTE_VALUE
public static final String NULL_ATTRIBUTE_VALUE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAllTags
public static HTML.Tag[] getAllTags()
Returns the set of actual HTML tags that are recognized by the default HTML reader. This set does not include tags that are manufactured by the reader.
-
getTag
public static HTML.Tag getTag(String tagName)
Fetches a tag constant for a well-known tag name (i.e. one of the tags in the set {A, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BIG, BLOCKQUOTE, BODY, BR, CAPTION, CENTER, CITE, CODE, DD, DFN, DIR, DIV, DL, DT, EM, FONT, FORM, FRAME, FRAMESET, H1, H2, H3, H4, H5, H6, HEAD, HR, HTML, I, IMG, INPUT, ISINDEX, KBD, LI, LINK, MAP, MENU, META, NOBR, NOFRAMES, OBJECT, OL, OPTION, P, PARAM, PRE, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, S, STRONG, STYLE, SUB, SUP, TABLE, TD, TEXTAREA, TH, TITLE, TR, TT, U, UL, VAR}. If the given name does not represent one of the well-known tags, thennull
will be returned.- Parameters:
tagName
- theString
name requested- Returns:
- a tag constant corresponding to the
tagName
, ornull
if not found
-
getIntegerAttributeValue
public static int getIntegerAttributeValue(AttributeSet attr, HTML.Attribute key, int def)
Fetches an integer attribute value. Attribute values are stored as a string, and this is a convenience method to convert to an actual integer.- Parameters:
attr
- the set of attributes to use to try to fetch a valuekey
- the key to use to fetch the valuedef
- the default value to use if the attribute isn't defined or there is an error converting to an integer
-
getAllAttributeKeys
public static HTML.Attribute[] getAllAttributeKeys()
Returns the set of HTML attributes recognized.- Returns:
- the set of HTML attributes recognized
-
getAttributeKey
public static HTML.Attribute getAttributeKey(String attName)
Fetches an attribute constant for a well-known attribute name (i.e. one of the attributes in the set {FACE, COMMENT, SIZE, COLOR, CLEAR, BACKGROUND, BGCOLOR, TEXT, LINK, VLINK, ALINK, WIDTH, HEIGHT, ALIGN, NAME, HREF, REL, REV, TITLE, TARGET, SHAPE, COORDS, ISMAP, NOHREF, ALT, ID, SRC, HSPACE, VSPACE, USEMAP, LOWSRC, CODEBASE, CODE, ARCHIVE, VALUE, VALUETYPE, TYPE, CLASS, STYLE, LANG, DIR, DECLARE, CLASSID, DATA, CODETYPE, STANDBY, BORDER, SHAPES, NOSHADE, COMPACT, START, ACTION, METHOD, ENCTYPE, CHECKED, MAXLENGTH, MULTIPLE, SELECTED, ROWS, COLS, DUMMY, CELLSPACING, CELLPADDING, VALIGN, HALIGN, NOWRAP, ROWSPAN, COLSPAN, PROMPT, HTTPEQUIV, CONTENT, LANGUAGE, VERSION, N, FRAMEBORDER, MARGINWIDTH, MARGINHEIGHT, SCROLLING, NORESIZE, MEDIA, ENDTAG}). If the given name does not represent one of the well-known attributes, thennull
will be returned.- Parameters:
attName
- theString
requested- Returns:
- the
Attribute
corresponding toattName
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
22/12/2024 15:52:35 Cette version de la page est en cache (à la date du 22/12/2024 15:52:35) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 30/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/swing/text/html/html.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.