Package org.apache.maven.doxia.sink
Class SinkEventAttributeSet
- java.lang.Object
-
- org.apache.maven.doxia.sink.SinkEventAttributeSet
-
- All Implemented Interfaces:
java.lang.Cloneable,javax.swing.text.AttributeSet,javax.swing.text.MutableAttributeSet,SinkEventAttributes
public class SinkEventAttributeSet extends java.lang.Object implements SinkEventAttributes, java.lang.Cloneable
Implementation of MutableAttributeSet using a LinkedHashMap.Moved here from
doxia-corein 2.2.0, so that attributes can be created without depending on Doxia internals. The deprecatedorg.apache.maven.doxia.sink.impl.SinkEventAttributeSetremains as a subclass of this class for binary compatibility, which means the constants declared here, and every attribute set Doxia itself creates, are instances of this class and no longer of that one.- Since:
- 1.1
- Author:
- ltheussl
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSinkEventAttributeSet.SemanticsAttribute sets for the semantic attribute.
-
Field Summary
Fields Modifier and Type Field Description static SinkEventAttributesBOLDAn unmodifiable attribute set containing only a bold attribute.static SinkEventAttributesCENTERAn unmodifiable attribute set containing only a center attribute.static SinkEventAttributesITALICAn unmodifiable attribute set containing only an italic attribute.static SinkEventAttributesJUSTIFYAn unmodifiable attribute set containing only a justify attribute.static SinkEventAttributesLEFTAn unmodifiable attribute set containing only a left attribute.static SinkEventAttributesLINETHROUGHAn unmodifiable attribute set containing only a linethrough attribute.static SinkEventAttributesMONOSPACEDAn unmodifiable attribute set containing only a monospaced attribute.static SinkEventAttributesOVERLINEAn unmodifiable attribute set containing only an overline attribute.static SinkEventAttributesRIGHTAn unmodifiable attribute set containing only a right attribute.static SinkEventAttributesSOURCEAn unmodifiable attribute set containing only a source attribute.static SinkEventAttributesUNDERLINEAn unmodifiable attribute set containing only an underline attribute.-
Fields inherited from interface org.apache.maven.doxia.sink.SinkEventAttributes
ABBRV, ALIGN, ALT, AXIS, BGCOLOR, BORDER, CELLPADDING, CELLSPACING, CHARSET, CLASS, COLSPAN, CONTENT, COORDS, DATETIME, DECORATION, EMAIL, FRAME, HEADERS, HEIGHT, HREF, HREFLANG, HSPACE, ID, ISMAP, LANG, NAME, NOSHADE, NOWRAP, PROFILE, REL, REV, ROWSPAN, RULES, SCOPE, SECTIONS, SEMANTICS, SHAPE, SIZE, SRC, STYLE, SUMMARY, TARGET, TITLE, TYPE, USEMAP, VALIGN, VALUE, VSPACE, WIDTH
-
-
Constructor Summary
Constructors Constructor Description SinkEventAttributeSet()Constructs a new, empty SinkEventAttributeSet with default size 5.SinkEventAttributeSet(int size)Constructs a new, empty SinkEventAttributeSet with the specified initial size.SinkEventAttributeSet(java.lang.String... attributes)Constructs a new SinkEventAttributeSet with the attribute name-value mappings as given by the specified String array.SinkEventAttributeSet(javax.swing.text.AttributeSet attributes)Constructs a new SinkEventAttributeSet with the same attribute name-value mappings as in the specified AttributeSet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttribute(java.lang.Object name, java.lang.Object value)Adds an attribute with the given name and value.voidaddAttributes(javax.swing.text.AttributeSet attributes)java.lang.Objectclone()booleancontainsAttribute(java.lang.Object name, java.lang.Object value)booleancontainsAttributes(javax.swing.text.AttributeSet attributes)javax.swing.text.AttributeSetcopyAttributes()java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>>entrySet()Returns aSetview of the attributes in form ofMap.Entryitems.booleanequals(java.lang.Object obj)java.lang.ObjectgetAttribute(java.lang.Object key)intgetAttributeCount()java.util.Enumeration<java.lang.String>getAttributeNames()javax.swing.text.AttributeSetgetResolveParent()inthashCode()booleanisDefined(java.lang.Object attrName)booleanisEmpty()Checks whether the set of attribs is empty.booleanisEqual(javax.swing.text.AttributeSet attr)voidremoveAttribute(java.lang.Object name)voidremoveAttributes(java.util.Enumeration<?> names)voidremoveAttributes(javax.swing.text.AttributeSet attributes)voidsetResolveParent(javax.swing.text.AttributeSet parent)java.lang.StringtoString()SinkEventAttributeSetunmodifiable()Replace this AttributeSet by an unmodifiable view of itself.
-
-
-
Field Detail
-
UNDERLINE
public static final SinkEventAttributes UNDERLINE
An unmodifiable attribute set containing only an underline attribute.
-
OVERLINE
public static final SinkEventAttributes OVERLINE
An unmodifiable attribute set containing only an overline attribute.
-
LINETHROUGH
public static final SinkEventAttributes LINETHROUGH
An unmodifiable attribute set containing only a linethrough attribute.
-
SOURCE
public static final SinkEventAttributes SOURCE
An unmodifiable attribute set containing only a source attribute.
-
BOLD
public static final SinkEventAttributes BOLD
An unmodifiable attribute set containing only a bold attribute.
-
ITALIC
public static final SinkEventAttributes ITALIC
An unmodifiable attribute set containing only an italic attribute.
-
MONOSPACED
public static final SinkEventAttributes MONOSPACED
An unmodifiable attribute set containing only a monospaced attribute.
-
LEFT
public static final SinkEventAttributes LEFT
An unmodifiable attribute set containing only a left attribute.
-
RIGHT
public static final SinkEventAttributes RIGHT
An unmodifiable attribute set containing only a right attribute.
-
CENTER
public static final SinkEventAttributes CENTER
An unmodifiable attribute set containing only a center attribute.
-
JUSTIFY
public static final SinkEventAttributes JUSTIFY
An unmodifiable attribute set containing only a justify attribute.
-
-
Constructor Detail
-
SinkEventAttributeSet
public SinkEventAttributeSet()
Constructs a new, empty SinkEventAttributeSet with default size 5.
-
SinkEventAttributeSet
public SinkEventAttributeSet(int size)
Constructs a new, empty SinkEventAttributeSet with the specified initial size.- Parameters:
size- the initial number of attribs.
-
SinkEventAttributeSet
public SinkEventAttributeSet(java.lang.String... attributes)
Constructs a new SinkEventAttributeSet with the attribute name-value mappings as given by the specified String array. Each even index of the array is an attribute name, and the following odd index is the corresponding attribute value. This constructor only supports String attribute values.- Parameters:
attributes- the specified String array. If the length of this array is not an even number, an IllegalArgumentException is thrown.
-
SinkEventAttributeSet
public SinkEventAttributeSet(javax.swing.text.AttributeSet attributes)
Constructs a new SinkEventAttributeSet with the same attribute name-value mappings as in the specified AttributeSet.- Parameters:
attributes- the specified AttributeSet.
-
-
Method Detail
-
unmodifiable
public SinkEventAttributeSet unmodifiable()
Replace this AttributeSet by an unmodifiable view of itself. Any subsequent attempt to add, remove or modify the underlying mapping will result in an UnsupportedOperationException.- Returns:
- an unmodifiable view of this AttributeSet.
- Since:
- 1.1.1
-
isEmpty
public boolean isEmpty()
Checks whether the set of attribs is empty.- Returns:
- true if the set is empty.
-
getAttributeCount
public int getAttributeCount()
- Specified by:
getAttributeCountin interfacejavax.swing.text.AttributeSet- Returns:
- a int.
-
isDefined
public boolean isDefined(java.lang.Object attrName)
- Specified by:
isDefinedin interfacejavax.swing.text.AttributeSet
-
isEqual
public boolean isEqual(javax.swing.text.AttributeSet attr)
- Specified by:
isEqualin interfacejavax.swing.text.AttributeSet
-
copyAttributes
public javax.swing.text.AttributeSet copyAttributes()
- Specified by:
copyAttributesin interfacejavax.swing.text.AttributeSet- Returns:
- a
AttributeSetobject.
-
getAttributeNames
public java.util.Enumeration<java.lang.String> getAttributeNames()
- Specified by:
getAttributeNamesin interfacejavax.swing.text.AttributeSet- Returns:
- a
Enumerationobject.
-
getAttribute
public java.lang.Object getAttribute(java.lang.Object key)
- Specified by:
getAttributein interfacejavax.swing.text.AttributeSet
-
containsAttribute
public boolean containsAttribute(java.lang.Object name, java.lang.Object value)- Specified by:
containsAttributein interfacejavax.swing.text.AttributeSet
-
containsAttributes
public boolean containsAttributes(javax.swing.text.AttributeSet attributes)
- Specified by:
containsAttributesin interfacejavax.swing.text.AttributeSet
-
addAttribute
public void addAttribute(java.lang.Object name, java.lang.Object value)Adds an attribute with the given name and value.- Specified by:
addAttributein interfacejavax.swing.text.MutableAttributeSet
-
addAttributes
public void addAttributes(javax.swing.text.AttributeSet attributes)
- Specified by:
addAttributesin interfacejavax.swing.text.MutableAttributeSet
-
removeAttribute
public void removeAttribute(java.lang.Object name)
- Specified by:
removeAttributein interfacejavax.swing.text.MutableAttributeSet
-
removeAttributes
public void removeAttributes(java.util.Enumeration<?> names)
- Specified by:
removeAttributesin interfacejavax.swing.text.MutableAttributeSet
-
removeAttributes
public void removeAttributes(javax.swing.text.AttributeSet attributes)
- Specified by:
removeAttributesin interfacejavax.swing.text.MutableAttributeSet- Parameters:
attributes- aAttributeSetobject.
-
getResolveParent
public javax.swing.text.AttributeSet getResolveParent()
- Specified by:
getResolveParentin interfacejavax.swing.text.AttributeSet- Returns:
- a
AttributeSetobject.
-
setResolveParent
public void setResolveParent(javax.swing.text.AttributeSet parent)
- Specified by:
setResolveParentin interfacejavax.swing.text.MutableAttributeSet
-
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
Description copied from interface:SinkEventAttributesReturns aSetview of the attributes in form ofMap.Entryitems. The set is backed by the underlying map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's ownremoveoperation, or through thesetValueoperation on a map entry returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via theIterator.remove,Set.remove,removeAll,retainAllandclearoperations. It does not support theaddoraddAlloperations.- Specified by:
entrySetin interfaceSinkEventAttributes- Returns:
- a set view of the attributes
-
clone
public java.lang.Object clone()
- Overrides:
clonein classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-