public interface SinkEventAttributes extends MutableAttributeSet
所有产生一些表示级输出的接收器方法都应该至少有一个允许传入一组 SinkEventAttributes 的形式。例如在
void text( String text, SinkEventAttributes attributes );
该attributes
参数可用于指定一些文本样式选项或其他可选参数。
支持哪种属性取决于事件和接收器实现。接收器 API 仅指定建议的属性名称列表,接收器应该识别这些属性名称,并且解析器应该在发出事件时优先使用。
建议对于简单的属性,键和值都应该是小写的字符串,但这不是强制性的。异常的一个示例是STYLE
属性,其值本身可能又是一个 AttributeSet。
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute
修饰符和类型 | 字段和说明 |
---|---|
static String |
ABBRV
指定元素中内容的缩写版本。
|
static String |
ALIGN
指定事件元素在其父元素内的对齐方式。
|
static String |
ALT
定义事件元素的简短描述。
|
static String |
AXIS
定义单元格的名称。
|
static String |
BGCOLOR
指定事件元素的背景颜色。
|
static String |
BORDER
定义事件元素周围的边框。
|
static String |
CELLPADDING
指定单元格壁和内容之间的空间。
|
static String |
CELLSPACING
指定单元格之间的间距。
|
static String |
CHARSET
指定与事件元素关联的文本的字符编码。
|
static String |
CLASS
事件元素的类。
|
static String |
COLSPAN
指示单元格应跨越的列数。
|
static String |
COORDS
可与 结合使用
SHAPE 。 |
static String |
DATETIME
为时间元素指定机器可读的日期/时间。
|
static String |
DECORATION
指定元素的装饰。
|
static String |
EMAIL
一个电子邮件地址。
|
static String |
FRAME
指定围绕元素的边框的哪些边应该可见。
|
static String |
HEADERS
以空格分隔的单元格 ID 列表,为单元格提供标头信息。
|
static String |
HEIGHT
定义事件元素的高度。
|
static String |
HREF
事件元素的目标 URL,例如链接。
|
static String |
HREFLANG
指定目标 URL 的基本语言。
|
static String |
HSPACE
在事件元素的左侧和右侧定义空白。
|
static String |
ID
事件元素的唯一 ID。
|
static String |
ISMAP
将图像定义为服务器端图像映射。
|
static String |
LANG
事件元素的语言代码。
|
static String |
NAME
指定锚点的名称。
|
static String |
NOSHADE
用于表示元素带有阴影。
|
static String |
NOWRAP
是否禁用或启用元素的自动文本换行。
|
static String |
PROFILE
一个以空格分隔的 URL 列表,其中包含有关文档的元数据信息。
|
static String |
REL
对于外部资源的引用,指定当前文档和目标 URL 之间的关系。
|
static String |
REV
对于外部资源的引用,指定目标 URL 和当前文档之间的关系。
|
static String |
ROWSPAN
指示单元格应跨越的行数。
|
static String |
RULES
指定某些元素之间的水平/垂直分隔线,例如表格单元格。
|
static String |
SCOPE
通用范围参数。
|
static String |
SECTIONS
指定元素的语义。
|
static String |
SEMANTICS
指定元素的语义。
|
static String |
SHAPE
定义要为映射定义的区域类型。
|
static String |
SIZE
指定事件元素的大小、厚度或高度。
|
static String |
SRC
外部资源的 URL,例如图像。
|
static String |
STYLE
内联样式定义。
|
static String |
SUMMARY
指定语音合成/非视觉目标输出的事件属性摘要。
|
static String |
TARGET
在哪里打开目标 URL。
|
static String |
TITLE
要在工具提示中显示的文本。
|
static String |
TYPE
指定外部资源 URL(例如链接)的 MIME(多用途 Internet 邮件扩展)类型。
|
static String |
USEMAP
将图像定义为客户端图像映射。
|
static String |
VALIGN
指定元素的垂直对齐方式。
|
static String |
VALUE
指定数据元素的值。
|
static String |
VSPACE
在事件元素的顶部和底部定义空白。
|
static String |
WIDTH
设置事件元素的宽度。
|
NameAttribute, ResolveAttribute
addAttribute, addAttributes, removeAttribute, removeAttributes, removeAttributes, setResolveParent
containsAttribute, containsAttributes, copyAttributes, getAttribute, getAttributeCount, getAttributeNames, getResolveParent, isDefined, isEqual
static final String STYLE
通常支持的值为“italic”、“bold”、“monospaced”和 AttributeSets。
如果此 Attribute 的值本身是一个 AttributeSet,则将其解释为 CSS 属性序列。例如,HTML 段落开头
<p style="color: red; margin-left: 20px">
可以由 HTML Sink 通过 event 生成
,其中 SinkEventAttribute 的值是具有两个 Attributes 的 AttributeSet(分别为“ Sink.paragraph(SinkEventAttributes)
color
”和“ margin-left
”,其值为“ red
”和“ 20px
”)。
static final String ALIGN
通常支持的值为“left”、“right”、“center”、“justify”。
static final String CELLPADDING
static final String CELLSPACING
static final String SCOPE
static final String VALIGN
一般接受的值为“top”、“baseline”、“middle”、“bottom”、“sup”、“sub”。
static final String DECORATION
一般接受的值是“下划线”、“上划线”、“直通”、“加框”。
static final String SEMANTICS
一般接受的值是“强调”、“强”、“小”、“直通”、“引文”、“引用”、“定义”、“缩写”、“斜体”、“粗体”、“等宽”、 “代码”、“变量”、“示例”、“键盘”、“上标”、“下标”、“注释”、“突出显示”、“ruby”、“rubyBase”、“rubyText”、“rubyTextContainer”、“rubyParentheses” 、“双向隔离”、“双向覆盖”、“短语”、“插入”、“删除”。
版权所有 © 2005–2022 Apache 软件基金会。版权所有。