+ /**
+ * Input tag
+ *
+ * @since 2.1
+ */
+ public enum Tag {
+ /** Ignore */
+ IGNORE(Messages.CustomXmlTraceDefinition_ignoreTag),
+ /** Timestamp */
+ TIMESTAMP(TmfBaseAspects.getTimestampAspect().getName()),
+ /** Event type */
+ EVENT_TYPE(TmfBaseAspects.getEventTypeAspect().getName()),
+ /** Message */
+ MESSAGE(Messages.CustomTraceDefinition_messageTag),
+ /** Extra field name
+ * @since 2.2*/
+ EXTRA_FIELD_NAME(Messages.CustomTraceDefinition_extraFieldNameTag),
+ /** Extra field value
+ * @since 2.2*/
+ EXTRA_FIELD_VALUE(Messages.CustomTraceDefinition_extraFieldValueTag),
+ /**
+ * Extra fields
+ * <p>
+ * Used as output tag corresponding to the {@link #EXTRA_FIELD_NAME} and
+ * {@link #EXTRA_FIELD_VALUE} input tags.
+ * @since 2.2
+ */
+ EXTRA_FIELDS(Messages.CustomExtraFieldsAspect_extraFieldsAspectName),
+ /** Other */
+ OTHER(Messages.CustomTraceDefinition_otherTag);
+
+ private final String fLabel;
+
+ private Tag(String label) {
+ fLabel = label;
+ }
+
+ @Override
+ public String toString() {
+ return fLabel;
+ }
+
+ /**
+ * Get a tag from its label (toString).
+ *
+ * @param label
+ * the label
+ * @return the corresponding tag, or null
+ */
+ public static Tag fromLabel(String label) {
+ for (Tag tag : Tag.values()) {
+ if (tag.toString().equals(label)) {
+ return tag;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Get a tag from its name (identifier).
+ *
+ * @param name
+ * the name
+ * @return the corresponding tag, or null
+ */
+ public static Tag fromName(String name) {
+ for (Tag tag : Tag.values()) {
+ if (tag.name().equals(name)) {
+ return tag;
+ }
+ }
+ return null;
+ }
+ }
+
+ /**
+ * Separator to use with the
+ * {@link CustomTraceDefinition#ACTION_APPEND_WITH_SEPARATOR}
+ *
+ * @since 2.2
+ */
+ public static final @NonNull String SEPARATOR = " | "; //$NON-NLS-1$
+
+ /** Timestamp tag
+ * @deprecated Use {@link Tag#TIMESTAMP} instead. */
+ @Deprecated