Package com.google.javascript.jscomp
Interface JsMessage.Part
-
- All Known Implementing Classes:
JsMessage.PlaceholderReference,JsMessage.StringPart
- Enclosing class:
- JsMessage
public static interface JsMessage.PartRepresents part of a message.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetCanonicalPlaceholderName()Gets the name of the placeholder as it would appear in XMB or XTB files, and also the form it takes when generating message IDs.java.lang.StringgetJsPlaceholderName()Gets the name of the placeholder as it would appear in JS code.java.lang.StringgetString()Gets the literal string for this message part.booleanisPlaceholder()True for placeholders, false for literal string parts.
-
-
-
Method Detail
-
isPlaceholder
boolean isPlaceholder()
True for placeholders, false for literal string parts.
-
getJsPlaceholderName
java.lang.String getJsPlaceholderName()
Gets the name of the placeholder as it would appear in JS code.In JS code placeholders are in lower camel case with zero or more trailing numeric suffixes (e.g. myPlaceholderName_123_456).
- Returns:
- the name for a placeholder
- Throws:
java.lang.UnsupportedOperationException- if this is not aJsMessage.PlaceholderReference.
-
getCanonicalPlaceholderName
java.lang.String getCanonicalPlaceholderName()
Gets the name of the placeholder as it would appear in XMB or XTB files, and also the form it takes when generating message IDs.This format is UPPER_SNAKE_CASE.
- Returns:
- the name for a placeholder
- Throws:
java.lang.UnsupportedOperationException- if this is not aJsMessage.PlaceholderReference.
-
getString
java.lang.String getString()
Gets the literal string for this message part.- Returns:
- the literal string for
JsMessage.StringPart. - Throws:
java.lang.UnsupportedOperationException- if this is not aJsMessage.StringPart.
-
-