Class ComponentSuffixGenerator
java.lang.Object
com.day.cq.wcm.designimporter.util.ComponentSuffixGenerator
Utility class that maintains stacked counters which can be used as suffixes for uniquely identifying names.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Ends a component stackGets the suffix for a component name.void
reset()
Resets the internal structures for maintaining the component stacks and suffixesvoid
Creates a new component stack for hierarchical suffixing.
-
Constructor Details
-
ComponentSuffixGenerator
public ComponentSuffixGenerator()
-
-
Method Details
-
getSuffix
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
-