Package com.atlassian.adf.model.mark
Class Border
- java.lang.Object
-
- com.atlassian.adf.model.mark.Border
-
@Documentation(state=UNDOCUMENTED, date="2023-07-26") public class Border extends Object implements MediaMark
Thebordermark sets border styling. This mark applies tomedianodes. This mark applies tomedianodes and indicates that the image should be decorated with a border with the givencolorandsizein pixels.The
colorshould be given as a 6- or 8-digit hexadecimal value prefixed with a hash mark; for example#ff00ccor#00ffcc24. Where the 8-digit form is used, the final 2 hex digits represent the value for the alpha channel, which controls the color's opacity.Example
Java
Media.fileMedia( "6e7c7f2c-dd7a-499c-bceb-6f32bfbf30b5", "my project files" ).border("#ff00cc").size(200, 183);ADF
{ "type": "media", "attrs": { "id": "6e7c7f2c-dd7a-499c-bceb-6f32bfbf30b5", "collection": "my project files", "type": "file", "width": 200, "height": 183 } }Result
Note: This example uses a data URI to embed the image instead of retrieving the image from media services, which uses a different mechanism to supply the image content.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.atlassian.adf.model.Element
Element.Key
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_COLORThe default color that will be used for the border if it is not explicitly given.static intDEFAULT_SIZEThe default size, in pixels, that will be used for the border if it is not explicitly given.static intMAXIMUM_SIZEThe maximum size, in pixels, that may be used for a border.static intMINIMUM_SIZEThe minimum size, in pixels, that may be used for a border.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Borderborder()static Borderborder(Colors.Named color)static Borderborder(Color color)static Borderborder(String color)Stringcolor()Bordercolor(Colors.Named color)Bordercolor(Color color)Bordercolor(String color)Bordercopy()Returns a deep copy of this element, including copies of any nodes or marks that it contains.StringelementType()Thetypevalue that identifies this element, such as"paragraph"or"strong".booleanequals(Object o)inthashCode()booleanisSupported()Indicates whether this element is fully supported by this library.protected FieldMapmapWithType()intsize()Bordersize(int size)Map<String,?>toMap()Transforms this element to a map ofStringvalues to various basic object types suitable for direct rendering as JSON content.StringtoString()voidvalidate()Verifies that the node is well-formed (including the state of any descendents that it has).-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.atlassian.adf.model.Element
isSupported, validate
-
-
-
-
Field Detail
-
DEFAULT_SIZE
public static final int DEFAULT_SIZE
The default size, in pixels, that will be used for the border if it is not explicitly given.- See Also:
- Constant Field Values
-
MINIMUM_SIZE
public static final int MINIMUM_SIZE
The minimum size, in pixels, that may be used for a border.- See Also:
- Constant Field Values
-
MAXIMUM_SIZE
public static final int MAXIMUM_SIZE
The maximum size, in pixels, that may be used for a border.- See Also:
- Constant Field Values
-
DEFAULT_COLOR
public static final String DEFAULT_COLOR
The default color that will be used for the border if it is not explicitly given.- See Also:
- Constant Field Values
-
-
Method Detail
-
border
public static Border border()
-
border
public static Border border(Colors.Named color)
-
size
public int size()
-
size
public Border size(int size)
-
color
public String color()
-
color
public Border color(Colors.Named color)
-
elementType
public String elementType()
Description copied from interface:ElementThetypevalue that identifies this element, such as"paragraph"or"strong".- Specified by:
elementTypein interfaceElement
-
toString
public String toString()
-
toMap
public Map<String,?> toMap()
Description copied from interface:ElementTransforms this element to a map ofStringvalues to various basic object types suitable for direct rendering as JSON content.
-
copy
public Border copy()
Description copied from interface:ElementReturns a deep copy of this element, including copies of any nodes or marks that it contains. The copy will not necessarily be in exactly the same state as the original in some cases. For example, atextnode that is used inside acodeBlockwill have the ability to use marks on it disabled, but a copy made of the text node using this method will not similarly disallow marks unless it is also added to a content node with those same restrictions.Implementations notes:
- Implementations should narrow the return type.
- Implementations should
return thisif the element is immutable. The@Immutableannotation should be used on the class to offer additional confirmation of this intent. - Implementations should
return parse(toMap())if they have state. - While there may be cases where it is worthwhile to do something more efficient than
the conversion to a map and back, this is discouraged because it would add yet another
fragile piece of code that breaks when new data is added to the node. The
parseandtoMapmethods already have to be updated in these circumstances, so it makes sense to take advantage of that.
-
mapWithType
protected FieldMap mapWithType()
-
isSupported
public boolean isSupported()
Description copied from interface:ElementIndicates whether this element is fully supported by this library. This library includes a small amount of support for preserving new, unrecognized node types during a round trip. These are represented by immutable placeholder objects that returnfalsefor this value.- Specified by:
isSupportedin interfaceElement- Returns:
truefor fully supported elements;falsefor immutable placeholders
-
-