public class SlugableListener extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Slugifier |
slugifier
Slugifier to be used to generate slugs.
|
| Constructor and Description |
|---|
SlugableListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
createSlugs(Object slugable)
Fills slugs on object creation.
|
protected void |
fillSlugs(Object slugable,
boolean update)
Fills slugs declared in given object.
|
protected String |
generateSlug(String[] texts,
Slug options)
Generate slug for give value.
|
protected Slugifier |
getSlugifier()
Returns initializer.
|
void |
updateSlugs(Object slugable)
Updates slugs.
|
@Inject protected Slugifier slugifier
protected Slugifier getSlugifier()
- In CDI-capable environment it will return slugifier injected by the container. - In non-CDI environment it will initialize default slugifier.
protected String generateSlug(String[] texts, Slug options)
texts - Initial value.options - Slug generation configuration.protected void fillSlugs(Object slugable, boolean update) throws IllegalAccessException
slugable - Object to be handled.update - Whether it's first save of slugs need to be only re-created.IllegalAccessException - When accessing source field is impossible.public void createSlugs(Object slugable) throws IllegalAccessException
slugable - Object to be handled.IllegalAccessException - When accessing source field is impossible.public void updateSlugs(Object slugable) throws IllegalAccessException
slugable - Object to be handled.IllegalAccessException - When accessing source field is impossible.Copyright © 2015 RafaĆ Wrzeszcz - Wrzasq.pl. All rights reserved.