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.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DynIdAttributedynId(java.lang.String value)Creates a dynamicidattribute that can be passed toTag.attr(Attribute).static java.lang.Stringref(java.lang.String value)Creates a reference (or a target anchor) for the givenid(for example for the target of an xlink)static voidresetDynIds()Removes allidcounters.static java.lang.Stringurl(java.lang.String value)Creates anurl()CSS function call using the reference for the givenidas parameter (to be used for example in SVG presentation attributes)-
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(java.lang.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>")
-
ref
public static java.lang.String ref(java.lang.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>"
-
url
public static java.lang.String url(java.lang.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>)"
-
-