Package de.obqo.decycle.report.svg
Class DynIdAttribute
- java.lang.Object
-
- j2html.attributes.Attribute
-
- de.obqo.decycle.report.svg.DynIdAttribute
-
- All Implemented Interfaces:
j2html.tags.Renderable
public class DynIdAttribute extends j2html.attributes.AttributeDynamicidattribute that will get a number appended to its value in order to achieve uniqueness within a HTML document. To be used for generated SVG that may appear multiple times in the same document.Note: it is necessary to
createthe id before creating anyreferencesorurls.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DynIdAttributedynId(String value)Creates a dynamicidattribute that can be passed toTag.attr(Attribute).static StringdynRef(String value)Creates a reference (or a target anchor) for the givenid(for example for the target of an xlink)static StringdynUrl(String value)Creates anurl()CSS function call using the reference for the givenidas parameter (to be used for example in SVG presentation attributes)static voidresetDynIds()Removes allidcounters.-
Methods inherited from class j2html.attributes.Attribute
getName, getValue, render, renderModel, setValue
-
-
-
-
Method Detail
-
resetDynIds
public static void resetDynIds()
Removes allidcounters. May be invoked before rendering a new HTML document.
-
dynId
public static DynIdAttribute dynId(String value)
Creates a dynamicidattribute that can be passed toTag.attr(Attribute).- Parameters:
value- the (base) value- Returns:
- the attribute (which renders to
id="value<n>")
-
dynRef
public static String dynRef(String value)
Creates a reference (or a target anchor) for the givenid(for example for the target of an xlink)- Parameters:
value- the (base) value of the targetidattribute- Returns:
- the
idreference:"#value<n>"for the last created id
-
dynUrl
public static String dynUrl(String value)
Creates anurl()CSS function call using the reference for the givenidas parameter (to be used for example in SVG presentation attributes)- Parameters:
value- the (base) value of the targetidattribute- Returns:
- the
url()function:"url(#value<n>)"for the last created id
-
-