Class ComponentSuffixGenerator
- java.lang.Object
-
- com.day.cq.wcm.designimporter.util.ComponentSuffixGenerator
-
public class ComponentSuffixGenerator extends java.lang.Object
Utility class that maintains stacked counters which can be used as suffixes for uniquely identifying names.
-
-
Constructor Summary
Constructors Constructor Description ComponentSuffixGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endComponentStack()
Ends a component stackjava.lang.String
getSuffix(java.lang.String componentName)
Gets the suffix for a component name.void
reset()
Resets the internal structures for maintaining the component stacks and suffixesvoid
startComponentStack()
Creates a new component stack for hierarchical suffixing.
-
-
-
Method Detail
-
getSuffix
public java.lang.String getSuffix(java.lang.String componentName)
Gets the suffix for a component name. The suffix scheme is to use an incrementing counter.- Parameters:
componentName
- The name of the component the suffix for which is desired- Returns:
- The suffix that uniquely identifies the component. If the api is consecutively called for the same component name, an incremented suffix value will be observed.
-
startComponentStack
public void startComponentStack()
Creates a new component stack for hierarchical suffixing. Same component names may bear the same suffix given that they are in different hierarchy levels
-
endComponentStack
public void endComponentStack()
Ends a component stack
-
reset
public void reset()
Resets the internal structures for maintaining the component stacks and suffixes
-
-