|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.rendering.util.IdGenerator
public class IdGenerator
Stateful generator of id attributes. It's stateful since it remembers the generated ids. Thus a new instance of it should be used for each document.
| Constructor Summary | |
|---|---|
IdGenerator()
|
|
| Method Summary | |
|---|---|
java.lang.String |
generateUniqueId(java.lang.String text)
Same as generateUniqueId(String, String) but with a fixed prefix of "I". |
java.lang.String |
generateUniqueId(java.lang.String prefix,
java.lang.String text)
Generate a unique id attribute using the passed text as the seed value. |
void |
remove(java.lang.String id)
Remove the saved previously generated id to make it available again. |
void |
reset()
Reset the known generated ids. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IdGenerator()
| Method Detail |
|---|
public java.lang.String generateUniqueId(java.lang.String text)
generateUniqueId(String, String) but with a fixed prefix of "I".
text - the text used to generate the unique id
public java.lang.String generateUniqueId(java.lang.String prefix,
java.lang.String text)
When defining fragment identifiers to be backward-compatible, only strings matching the pattern
[A-Za-z][A-Za-z0-9:_.-]* should be used.
prefix - the prefix of the identifier. Has to match [a-zA-Z].text - the text used to generate the unique id
public void remove(java.lang.String id)
id - the id to remove from the generated ids.public void reset()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||