Package com.google.javascript.jscomp
Class JsMessage.PlaceholderReference
- java.lang.Object
-
- com.google.javascript.jscomp.JsMessage.PlaceholderReference
-
- All Implemented Interfaces:
JsMessage.Part
- Enclosing class:
- JsMessage
public abstract static class JsMessage.PlaceholderReference extends java.lang.Object implements JsMessage.Part
A reference to a placeholder in a translatable message.
-
-
Constructor Summary
Constructors Constructor Description PlaceholderReference()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static JsMessage.PlaceholderReferencecreateForCanonicalName(java.lang.String name)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.abstract java.lang.StringgetStoredPlaceholderName()java.lang.StringgetString()Gets the literal string for this message part.abstract booleanisCanonicalFormat()booleanisPlaceholder()True for placeholders, false for literal string parts.
-
-
-
Method Detail
-
createForCanonicalName
public static JsMessage.PlaceholderReference createForCanonicalName(java.lang.String name)
-
getStoredPlaceholderName
public abstract java.lang.String getStoredPlaceholderName()
-
isCanonicalFormat
public abstract boolean isCanonicalFormat()
-
isPlaceholder
public boolean isPlaceholder()
Description copied from interface:JsMessage.PartTrue for placeholders, false for literal string parts.- Specified by:
isPlaceholderin interfaceJsMessage.Part
-
getJsPlaceholderName
public java.lang.String getJsPlaceholderName()
Description copied from interface:JsMessage.PartGets 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).
- Specified by:
getJsPlaceholderNamein interfaceJsMessage.Part- Returns:
- the name for a placeholder
-
getCanonicalPlaceholderName
public java.lang.String getCanonicalPlaceholderName()
Description copied from interface:JsMessage.PartGets 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.
- Specified by:
getCanonicalPlaceholderNamein interfaceJsMessage.Part- Returns:
- the name for a placeholder
-
getString
public java.lang.String getString()
Description copied from interface:JsMessage.PartGets the literal string for this message part.- Specified by:
getStringin interfaceJsMessage.Part- Returns:
- the literal string for
JsMessage.StringPart.
-
-