- All Superinterfaces:
IdResolver,IdSupplier
- All Known Implementing Classes:
SimpleIdFactory
IdFactory.
- Author:
- Werner Randelshofer
-
Method Summary
Modifier and TypeMethodDescriptionCreates an id for the specified object.Creates an id for the specified object.Creates an id for the specified object.putIdAndObject(@NonNull String id, @NonNull Object object) Puts the id and the object for mapping between them.putIdToObject(@NonNull String id, @NonNull Object object) Puts the id for mapping to the specified object.voidreset()Clears all ids.voidsetDocumentHome(@Nullable URI documentHome) Methods inherited from interface org.jhotdraw8.base.converter.IdResolver
absolutize, getObject, getObjectMethods inherited from interface org.jhotdraw8.base.converter.IdSupplier
getId, relativize
-
Method Details
-
setDocumentHome
-
createId
Creates an id for the specified object. If the object already has an id, then that id is returned.- Parameters:
object- the object- Returns:
- the id
-
createId
Creates an id for the specified object. If the object already has an id, then that id is returned.- Parameters:
object- the objectprefix- the desired prefix for the id- Returns:
- the id
-
createId
Creates an id for the specified object. If the object already has an id, then that id is returned. If the object has no id and the suggestedId has not been assigned to an object yet, then the suggestedId is used.- Parameters:
object- the objectprefix- the prefix used to create a new id, if the suggested id is takensuggestedId- the suggested id- Returns:
- the id
-
putIdAndObject
Puts the id and the object for mapping between them.If the object already has an id, the old id is replaced.
- Parameters:
id- the idobject- the object- Returns:
- the object that previously was assigned to this id
-
putIdToObject
Puts the id for mapping to the specified object.- Parameters:
id- the idobject- the object- Returns:
- the object that previously was assigned to this id
-
reset
void reset()Clears all ids.
-