repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
google/closure-templates
java/src/com/google/template/soy/jssrc/internal/AliasUtils.java
AliasUtils.createTemplateAliases
static TemplateAliases createTemplateAliases(SoyFileNode fileNode) { Map<String, String> aliasMap = new HashMap<>(); Set<String> localTemplates = new HashSet<>(); int counter = 0; ImmutableList.Builder<TemplateNode> templates = ImmutableList.builder(); templates .addAll(SoyTreeUtils.getAllNodesOfType(fileNode, TemplateBasicNode.class)) .addAll(SoyTreeUtils.getAllNodesOfType(fileNode, TemplateElementNode.class)); // Go through templates first and just alias them to their local name. for (TemplateNode templateNode : templates.build()) { String partialName = templateNode.getPartialTemplateName(); String fullyQualifiedName = templateNode.getTemplateName(); localTemplates.add(fullyQualifiedName); Preconditions.checkState(partialName != null, "Aliasing not supported for V1 templates"); // Need to start the alias with something that cannot be a part of a reserved // JavaScript identifier like 'function' or 'catch'. String alias = "$" + partialName.substring(1); aliasMap.put(fullyQualifiedName, alias); } // Go through all call sites looking for foreign template calls and create an alias for them. for (CallBasicNode callBasicNode : SoyTreeUtils.getAllNodesOfType(fileNode, CallBasicNode.class)) { String fullyQualifiedName = callBasicNode.getCalleeName(); // We could have either encountered the foreign fully qualified name before or it could belong // to a local template. if (localTemplates.contains(fullyQualifiedName) || aliasMap.containsKey(fullyQualifiedName)) { continue; } String alias = TEMPLATE_ALIAS_PREFIX + (++counter); aliasMap.put(fullyQualifiedName, alias); } return new Aliases(aliasMap); }
java
static TemplateAliases createTemplateAliases(SoyFileNode fileNode) { Map<String, String> aliasMap = new HashMap<>(); Set<String> localTemplates = new HashSet<>(); int counter = 0; ImmutableList.Builder<TemplateNode> templates = ImmutableList.builder(); templates .addAll(SoyTreeUtils.getAllNodesOfType(fileNode, TemplateBasicNode.class)) .addAll(SoyTreeUtils.getAllNodesOfType(fileNode, TemplateElementNode.class)); // Go through templates first and just alias them to their local name. for (TemplateNode templateNode : templates.build()) { String partialName = templateNode.getPartialTemplateName(); String fullyQualifiedName = templateNode.getTemplateName(); localTemplates.add(fullyQualifiedName); Preconditions.checkState(partialName != null, "Aliasing not supported for V1 templates"); // Need to start the alias with something that cannot be a part of a reserved // JavaScript identifier like 'function' or 'catch'. String alias = "$" + partialName.substring(1); aliasMap.put(fullyQualifiedName, alias); } // Go through all call sites looking for foreign template calls and create an alias for them. for (CallBasicNode callBasicNode : SoyTreeUtils.getAllNodesOfType(fileNode, CallBasicNode.class)) { String fullyQualifiedName = callBasicNode.getCalleeName(); // We could have either encountered the foreign fully qualified name before or it could belong // to a local template. if (localTemplates.contains(fullyQualifiedName) || aliasMap.containsKey(fullyQualifiedName)) { continue; } String alias = TEMPLATE_ALIAS_PREFIX + (++counter); aliasMap.put(fullyQualifiedName, alias); } return new Aliases(aliasMap); }
[ "static", "TemplateAliases", "createTemplateAliases", "(", "SoyFileNode", "fileNode", ")", "{", "Map", "<", "String", ",", "String", ">", "aliasMap", "=", "new", "HashMap", "<>", "(", ")", ";", "Set", "<", "String", ">", "localTemplates", "=", "new", "HashSe...
Creates a mapping for assigning and looking up the variable alias for templates both within a file and referenced from external files. For local files, the alias is just the local template's name. For external templates, the alias is an identifier that is unique for that template. <p>For V1 templates, no alias is generated and the template should be called by the fully qualified name. @param fileNode The {@link SoyFileNode} to create an alias mapping for. @return A {@link TemplateAliases} to look up aliases with.
[ "Creates", "a", "mapping", "for", "assigning", "and", "looking", "up", "the", "variable", "alias", "for", "templates", "both", "within", "a", "file", "and", "referenced", "from", "external", "files", ".", "For", "local", "files", "the", "alias", "is", "just"...
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/internal/AliasUtils.java#L77-L116
train
google/closure-templates
java/src/com/google/template/soy/jbcsrc/TemplateVariableManager.java
TemplateVariableManager.generateTableEntries
void generateTableEntries(CodeBuilder ga) { for (Variable var : allVariables) { try { var.local.tableEntry(ga); } catch (Throwable t) { throw new RuntimeException("unable to write table entry for: " + var.local, t); } } }
java
void generateTableEntries(CodeBuilder ga) { for (Variable var : allVariables) { try { var.local.tableEntry(ga); } catch (Throwable t) { throw new RuntimeException("unable to write table entry for: " + var.local, t); } } }
[ "void", "generateTableEntries", "(", "CodeBuilder", "ga", ")", "{", "for", "(", "Variable", "var", ":", "allVariables", ")", "{", "try", "{", "var", ".", "local", ".", "tableEntry", "(", "ga", ")", ";", "}", "catch", "(", "Throwable", "t", ")", "{", ...
Write a local variable table entry for every registered variable.
[ "Write", "a", "local", "variable", "table", "entry", "for", "every", "registered", "variable", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/TemplateVariableManager.java#L415-L423
train
google/closure-templates
java/src/com/google/template/soy/jbcsrc/TemplateVariableManager.java
TemplateVariableManager.defineFields
void defineFields(ClassVisitor writer) { for (Variable var : allVariables) { var.maybeDefineField(writer); } if (currentCalleeField != null) { currentCalleeField.defineField(writer); } if (currentRendereeField != null) { currentRendereeField.defineField(writer); } if (currentAppendable != null) { currentAppendable.defineField(writer); } }
java
void defineFields(ClassVisitor writer) { for (Variable var : allVariables) { var.maybeDefineField(writer); } if (currentCalleeField != null) { currentCalleeField.defineField(writer); } if (currentRendereeField != null) { currentRendereeField.defineField(writer); } if (currentAppendable != null) { currentAppendable.defineField(writer); } }
[ "void", "defineFields", "(", "ClassVisitor", "writer", ")", "{", "for", "(", "Variable", "var", ":", "allVariables", ")", "{", "var", ".", "maybeDefineField", "(", "writer", ")", ";", "}", "if", "(", "currentCalleeField", "!=", "null", ")", "{", "currentCa...
Defines all the fields necessary for the registered variables.
[ "Defines", "all", "the", "fields", "necessary", "for", "the", "registered", "variables", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/TemplateVariableManager.java#L448-L461
train
google/closure-templates
java/src/com/google/template/soy/jbcsrc/TemplateVariableManager.java
TemplateVariableManager.getCurrentCalleeField
FieldRef getCurrentCalleeField() { FieldRef local = currentCalleeField; if (local == null) { local = currentCalleeField = FieldRef.createField(owner, CURRENT_CALLEE_FIELD, CompiledTemplate.class); } return local; }
java
FieldRef getCurrentCalleeField() { FieldRef local = currentCalleeField; if (local == null) { local = currentCalleeField = FieldRef.createField(owner, CURRENT_CALLEE_FIELD, CompiledTemplate.class); } return local; }
[ "FieldRef", "getCurrentCalleeField", "(", ")", "{", "FieldRef", "local", "=", "currentCalleeField", ";", "if", "(", "local", "==", "null", ")", "{", "local", "=", "currentCalleeField", "=", "FieldRef", ".", "createField", "(", "owner", ",", "CURRENT_CALLEE_FIELD...
Returns the field that holds the current callee template. <p>Unlike normal variables the VariableSet doesn't maintain responsibility for saving and restoring the current callee to a local.
[ "Returns", "the", "field", "that", "holds", "the", "current", "callee", "template", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/TemplateVariableManager.java#L488-L496
train
google/closure-templates
java/src/com/google/template/soy/jbcsrc/TemplateVariableManager.java
TemplateVariableManager.getCurrentRenderee
FieldRef getCurrentRenderee() { FieldRef local = currentRendereeField; if (local == null) { local = currentRendereeField = FieldRef.createField(owner, CURRENT_RENDEREE_FIELD, SoyValueProvider.class); } return local; }
java
FieldRef getCurrentRenderee() { FieldRef local = currentRendereeField; if (local == null) { local = currentRendereeField = FieldRef.createField(owner, CURRENT_RENDEREE_FIELD, SoyValueProvider.class); } return local; }
[ "FieldRef", "getCurrentRenderee", "(", ")", "{", "FieldRef", "local", "=", "currentRendereeField", ";", "if", "(", "local", "==", "null", ")", "{", "local", "=", "currentRendereeField", "=", "FieldRef", ".", "createField", "(", "owner", ",", "CURRENT_RENDEREE_FI...
Returns the field that holds the currently rendering SoyValueProvider. <p>Unlike normal variables the VariableSet doesn't maintain responsibility for saving and restoring the current renderee to a local.
[ "Returns", "the", "field", "that", "holds", "the", "currently", "rendering", "SoyValueProvider", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/TemplateVariableManager.java#L504-L512
train
google/closure-templates
java/src/com/google/template/soy/jbcsrc/TemplateVariableManager.java
TemplateVariableManager.getCurrentAppendable
FieldRef getCurrentAppendable() { FieldRef local = currentAppendable; if (local == null) { local = currentAppendable = FieldRef.createField( owner, CURRENT_APPENDABLE_FIELD, LoggingAdvisingAppendable.class); } return local; }
java
FieldRef getCurrentAppendable() { FieldRef local = currentAppendable; if (local == null) { local = currentAppendable = FieldRef.createField( owner, CURRENT_APPENDABLE_FIELD, LoggingAdvisingAppendable.class); } return local; }
[ "FieldRef", "getCurrentAppendable", "(", ")", "{", "FieldRef", "local", "=", "currentAppendable", ";", "if", "(", "local", "==", "null", ")", "{", "local", "=", "currentAppendable", "=", "FieldRef", ".", "createField", "(", "owner", ",", "CURRENT_APPENDABLE_FIEL...
Returns the field that holds the currently rendering LoggingAdvisingAppendable object that is used for streaming renders. <p>Unlike normal variables the VariableSet doesn't maintain responsibility for saving and restoring the current renderee to a local. <p>TODO(lukes): it would be better if the VariableSet would save/restore... the issue is allowing multiple uses within a template to share the field.
[ "Returns", "the", "field", "that", "holds", "the", "currently", "rendering", "LoggingAdvisingAppendable", "object", "that", "is", "used", "for", "streaming", "renders", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/TemplateVariableManager.java#L524-L533
train
google/closure-templates
java/src/com/google/template/soy/jbcsrc/TemplateVariableManager.java
TemplateVariableManager.getVariable
Variable getVariable(String name) { VarKey varKey = VarKey.create(Kind.USER_DEFINED, name); return getVariable(varKey); }
java
Variable getVariable(String name) { VarKey varKey = VarKey.create(Kind.USER_DEFINED, name); return getVariable(varKey); }
[ "Variable", "getVariable", "(", "String", "name", ")", "{", "VarKey", "varKey", "=", "VarKey", ".", "create", "(", "Kind", ".", "USER_DEFINED", ",", "name", ")", ";", "return", "getVariable", "(", "varKey", ")", ";", "}" ]
Looks up a user defined variable with the given name. The variable must have been created in a currently active scope.
[ "Looks", "up", "a", "user", "defined", "variable", "with", "the", "given", "name", ".", "The", "variable", "must", "have", "been", "created", "in", "a", "currently", "active", "scope", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/TemplateVariableManager.java#L539-L542
train
google/closure-templates
java/src/com/google/template/soy/jbcsrc/TemplateVariableManager.java
TemplateVariableManager.getVariable
Variable getVariable(SyntheticVarName name) { VarKey varKey = VarKey.create(Kind.SYNTHETIC, name.name()); return getVariable(varKey); }
java
Variable getVariable(SyntheticVarName name) { VarKey varKey = VarKey.create(Kind.SYNTHETIC, name.name()); return getVariable(varKey); }
[ "Variable", "getVariable", "(", "SyntheticVarName", "name", ")", "{", "VarKey", "varKey", "=", "VarKey", ".", "create", "(", "Kind", ".", "SYNTHETIC", ",", "name", ".", "name", "(", ")", ")", ";", "return", "getVariable", "(", "varKey", ")", ";", "}" ]
Looks up a synthetic variable with the given name. The variable must have been created in a currently active scope.
[ "Looks", "up", "a", "synthetic", "variable", "with", "the", "given", "name", ".", "The", "variable", "must", "have", "been", "created", "in", "a", "currently", "active", "scope", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/TemplateVariableManager.java#L548-L551
train
google/closure-templates
java/src/com/google/template/soy/internal/i18n/BidiFormatter.java
BidiFormatter.knownDirAttrSanitized
public SanitizedContent knownDirAttrSanitized(Dir dir) { Preconditions.checkNotNull(dir); if (dir != contextDir) { switch (dir) { case LTR: return LTR_DIR; case RTL: return RTL_DIR; case NEUTRAL: // fall out. } } return NEUTRAL_DIR; }
java
public SanitizedContent knownDirAttrSanitized(Dir dir) { Preconditions.checkNotNull(dir); if (dir != contextDir) { switch (dir) { case LTR: return LTR_DIR; case RTL: return RTL_DIR; case NEUTRAL: // fall out. } } return NEUTRAL_DIR; }
[ "public", "SanitizedContent", "knownDirAttrSanitized", "(", "Dir", "dir", ")", "{", "Preconditions", ".", "checkNotNull", "(", "dir", ")", ";", "if", "(", "dir", "!=", "contextDir", ")", "{", "switch", "(", "dir", ")", "{", "case", "LTR", ":", "return", ...
Returns "dir=\"ltr\"" or "dir=\"rtl\"", depending on the given directionality, if it is not NEUTRAL or the same as the context directionality. Otherwise, returns "". @param dir Given directionality. Must not be null. @return "dir=\"rtl\"" for RTL text in non-RTL context; "dir=\"ltr\"" for LTR text in non-LTR context; else, the empty string.
[ "Returns", "dir", "=", "\\", "ltr", "\\", "or", "dir", "=", "\\", "rtl", "\\", "depending", "on", "the", "given", "directionality", "if", "it", "is", "not", "NEUTRAL", "or", "the", "same", "as", "the", "context", "directionality", ".", "Otherwise", "retu...
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/internal/i18n/BidiFormatter.java#L87-L100
train
google/closure-templates
java/src/com/google/template/soy/internal/i18n/BidiFormatter.java
BidiFormatter.estimateDirection
@VisibleForTesting static Dir estimateDirection(String str, boolean isHtml) { return BidiUtils.estimateDirection(str, isHtml); }
java
@VisibleForTesting static Dir estimateDirection(String str, boolean isHtml) { return BidiUtils.estimateDirection(str, isHtml); }
[ "@", "VisibleForTesting", "static", "Dir", "estimateDirection", "(", "String", "str", ",", "boolean", "isHtml", ")", "{", "return", "BidiUtils", ".", "estimateDirection", "(", "str", ",", "isHtml", ")", ";", "}" ]
Estimates the directionality of a string using the best known general-purpose method, i.e. using relative word counts. Dir.NEUTRAL return value indicates completely neutral input. @param str String whose directionality is to be estimated @param isHtml Whether {@code str} is HTML / HTML-escaped @return {@code str}'s estimated overall directionality
[ "Estimates", "the", "directionality", "of", "a", "string", "using", "the", "best", "known", "general", "-", "purpose", "method", "i", ".", "e", ".", "using", "relative", "word", "counts", ".", "Dir", ".", "NEUTRAL", "return", "value", "indicates", "completel...
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/internal/i18n/BidiFormatter.java#L245-L248
train
google/closure-templates
java/src/com/google/template/soy/conformance/ValidatedConformanceConfig.java
ValidatedConformanceConfig.create
public static ValidatedConformanceConfig create(ConformanceConfig config) { ImmutableList.Builder<RuleWithWhitelists> rulesBuilder = new ImmutableList.Builder<>(); for (Requirement requirement : config.getRequirementList()) { Preconditions.checkArgument( !requirement.getErrorMessage().isEmpty(), "requirement missing error message"); Preconditions.checkArgument( requirement.getRequirementTypeCase() != RequirementTypeCase.REQUIREMENTTYPE_NOT_SET, "requirement missing type"); Rule<? extends Node> rule = forRequirement(requirement); ImmutableList<String> whitelists = ImmutableList.copyOf(requirement.getWhitelistList()); ImmutableList<String> onlyApplyToPaths = ImmutableList.copyOf(requirement.getOnlyApplyToList()); rulesBuilder.add(RuleWithWhitelists.create(rule, whitelists, onlyApplyToPaths)); } return new ValidatedConformanceConfig(rulesBuilder.build()); }
java
public static ValidatedConformanceConfig create(ConformanceConfig config) { ImmutableList.Builder<RuleWithWhitelists> rulesBuilder = new ImmutableList.Builder<>(); for (Requirement requirement : config.getRequirementList()) { Preconditions.checkArgument( !requirement.getErrorMessage().isEmpty(), "requirement missing error message"); Preconditions.checkArgument( requirement.getRequirementTypeCase() != RequirementTypeCase.REQUIREMENTTYPE_NOT_SET, "requirement missing type"); Rule<? extends Node> rule = forRequirement(requirement); ImmutableList<String> whitelists = ImmutableList.copyOf(requirement.getWhitelistList()); ImmutableList<String> onlyApplyToPaths = ImmutableList.copyOf(requirement.getOnlyApplyToList()); rulesBuilder.add(RuleWithWhitelists.create(rule, whitelists, onlyApplyToPaths)); } return new ValidatedConformanceConfig(rulesBuilder.build()); }
[ "public", "static", "ValidatedConformanceConfig", "create", "(", "ConformanceConfig", "config", ")", "{", "ImmutableList", ".", "Builder", "<", "RuleWithWhitelists", ">", "rulesBuilder", "=", "new", "ImmutableList", ".", "Builder", "<>", "(", ")", ";", "for", "(",...
Creates a validated configuration object. @throws IllegalArgumentException if there is an error in the config object.
[ "Creates", "a", "validated", "configuration", "object", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/conformance/ValidatedConformanceConfig.java#L45-L60
train
google/closure-templates
java/src/com/google/template/soy/conformance/ValidatedConformanceConfig.java
ValidatedConformanceConfig.createCustomRule
private static Rule<?> createCustomRule(String javaClass, SoyErrorKind error) { Class<? extends Rule<?>> customRuleClass; try { @SuppressWarnings("unchecked") Class<? extends Rule<?>> asSubclass = (Class<? extends Rule<?>>) Class.forName(javaClass).asSubclass(Rule.class); customRuleClass = asSubclass; } catch (ClassNotFoundException e) { throw new IllegalArgumentException("custom rule class " + javaClass + " not found", e); } try { // It is ok for the constructor to be non-public as long as it is defined in this package // if it is non public and defined in another package, this will throw an // IllegalAccessException which seems about right. Constructor<? extends Rule<?>> ctor = customRuleClass.getDeclaredConstructor(SoyErrorKind.class); return ctor.newInstance(error); } catch (ReflectiveOperationException e) { throw new IllegalArgumentException( "unable to construct custom rule class: " + javaClass + ": " + e.getMessage(), e); } }
java
private static Rule<?> createCustomRule(String javaClass, SoyErrorKind error) { Class<? extends Rule<?>> customRuleClass; try { @SuppressWarnings("unchecked") Class<? extends Rule<?>> asSubclass = (Class<? extends Rule<?>>) Class.forName(javaClass).asSubclass(Rule.class); customRuleClass = asSubclass; } catch (ClassNotFoundException e) { throw new IllegalArgumentException("custom rule class " + javaClass + " not found", e); } try { // It is ok for the constructor to be non-public as long as it is defined in this package // if it is non public and defined in another package, this will throw an // IllegalAccessException which seems about right. Constructor<? extends Rule<?>> ctor = customRuleClass.getDeclaredConstructor(SoyErrorKind.class); return ctor.newInstance(error); } catch (ReflectiveOperationException e) { throw new IllegalArgumentException( "unable to construct custom rule class: " + javaClass + ": " + e.getMessage(), e); } }
[ "private", "static", "Rule", "<", "?", ">", "createCustomRule", "(", "String", "javaClass", ",", "SoyErrorKind", "error", ")", "{", "Class", "<", "?", "extends", "Rule", "<", "?", ">", ">", "customRuleClass", ";", "try", "{", "@", "SuppressWarnings", "(", ...
Instantiates a custom conformance check from its fully-qualified class name, specified in the conformance protobuf. <p>Custom conformance checks must extend {@link Rule}. They must also have a binary constructor with {@link ErrorReporter} and {@link SoyErrorKind} parameters.
[ "Instantiates", "a", "custom", "conformance", "check", "from", "its", "fully", "-", "qualified", "class", "name", "specified", "in", "the", "conformance", "protobuf", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/conformance/ValidatedConformanceConfig.java#L113-L134
train
google/closure-templates
java/src/com/google/template/soy/jssrc/SoyJsSrcOptions.java
SoyJsSrcOptions.setUseGoogIsRtlForBidiGlobalDir
public void setUseGoogIsRtlForBidiGlobalDir(boolean useGoogIsRtlForBidiGlobalDir) { Preconditions.checkState( !useGoogIsRtlForBidiGlobalDir || shouldGenerateGoogMsgDefs, "Do not specify useGoogIsRtlForBidiGlobalDir without shouldGenerateGoogMsgDefs."); Preconditions.checkState( !useGoogIsRtlForBidiGlobalDir || bidiGlobalDir == 0, "Must not specify both bidiGlobalDir and useGoogIsRtlForBidiGlobalDir."); this.useGoogIsRtlForBidiGlobalDir = useGoogIsRtlForBidiGlobalDir; }
java
public void setUseGoogIsRtlForBidiGlobalDir(boolean useGoogIsRtlForBidiGlobalDir) { Preconditions.checkState( !useGoogIsRtlForBidiGlobalDir || shouldGenerateGoogMsgDefs, "Do not specify useGoogIsRtlForBidiGlobalDir without shouldGenerateGoogMsgDefs."); Preconditions.checkState( !useGoogIsRtlForBidiGlobalDir || bidiGlobalDir == 0, "Must not specify both bidiGlobalDir and useGoogIsRtlForBidiGlobalDir."); this.useGoogIsRtlForBidiGlobalDir = useGoogIsRtlForBidiGlobalDir; }
[ "public", "void", "setUseGoogIsRtlForBidiGlobalDir", "(", "boolean", "useGoogIsRtlForBidiGlobalDir", ")", "{", "Preconditions", ".", "checkState", "(", "!", "useGoogIsRtlForBidiGlobalDir", "||", "shouldGenerateGoogMsgDefs", ",", "\"Do not specify useGoogIsRtlForBidiGlobalDir withou...
Sets the Javascript code snippet that will evaluate at template runtime to a boolean value indicating whether the bidi global direction is rtl. Can only be used when shouldGenerateGoogMsgDefs is true. @param useGoogIsRtlForBidiGlobalDir Whether to determine the bidi global direction at template runtime by evaluating goog.i18n.bidi.IS_RTL.
[ "Sets", "the", "Javascript", "code", "snippet", "that", "will", "evaluate", "at", "template", "runtime", "to", "a", "boolean", "value", "indicating", "whether", "the", "bidi", "global", "direction", "is", "rtl", ".", "Can", "only", "be", "used", "when", "sho...
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/SoyJsSrcOptions.java#L189-L197
train
google/closure-templates
java/src/com/google/template/soy/pysrc/internal/TranslateToPyExprVisitor.java
TranslateToPyExprVisitor.visitPrimitiveNode
@Override protected PyExpr visitPrimitiveNode(PrimitiveNode node) { // Note: ExprNode.toSourceString() technically returns a Soy expression. In the case of // primitives, the result is usually also the correct Python expression. return new PyExpr(node.toSourceString(), Integer.MAX_VALUE); }
java
@Override protected PyExpr visitPrimitiveNode(PrimitiveNode node) { // Note: ExprNode.toSourceString() technically returns a Soy expression. In the case of // primitives, the result is usually also the correct Python expression. return new PyExpr(node.toSourceString(), Integer.MAX_VALUE); }
[ "@", "Override", "protected", "PyExpr", "visitPrimitiveNode", "(", "PrimitiveNode", "node", ")", "{", "// Note: ExprNode.toSourceString() technically returns a Soy expression. In the case of", "// primitives, the result is usually also the correct Python expression.", "return", "new", "P...
Implementations for primitives.
[ "Implementations", "for", "primitives", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/pysrc/internal/TranslateToPyExprVisitor.java#L183-L188
train
google/closure-templates
java/src/com/google/template/soy/pysrc/internal/TranslateToPyExprVisitor.java
TranslateToPyExprVisitor.genPyExprUsingSoySyntax
private PyExpr genPyExprUsingSoySyntax(OperatorNode opNode) { List<PyExpr> operandPyExprs = visitChildren(opNode); String newExpr = PyExprUtils.genExprWithNewToken(opNode.getOperator(), operandPyExprs, null); return new PyExpr(newExpr, PyExprUtils.pyPrecedenceForOperator(opNode.getOperator())); }
java
private PyExpr genPyExprUsingSoySyntax(OperatorNode opNode) { List<PyExpr> operandPyExprs = visitChildren(opNode); String newExpr = PyExprUtils.genExprWithNewToken(opNode.getOperator(), operandPyExprs, null); return new PyExpr(newExpr, PyExprUtils.pyPrecedenceForOperator(opNode.getOperator())); }
[ "private", "PyExpr", "genPyExprUsingSoySyntax", "(", "OperatorNode", "opNode", ")", "{", "List", "<", "PyExpr", ">", "operandPyExprs", "=", "visitChildren", "(", "opNode", ")", ";", "String", "newExpr", "=", "PyExprUtils", ".", "genExprWithNewToken", "(", "opNode"...
Generates a Python expression for the given OperatorNode's subtree assuming that the Python expression for the operator uses the same syntax format as the Soy operator. @param opNode the OperatorNode whose subtree to generate a Python expression for @return the generated Python expression
[ "Generates", "a", "Python", "expression", "for", "the", "given", "OperatorNode", "s", "subtree", "assuming", "that", "the", "Python", "expression", "for", "the", "operator", "uses", "the", "same", "syntax", "format", "as", "the", "Soy", "operator", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/pysrc/internal/TranslateToPyExprVisitor.java#L641-L646
train
google/closure-templates
java/src/com/google/template/soy/base/internal/BaseUtils.java
BaseUtils.ensureDirsExistInPath
public static void ensureDirsExistInPath(String path) { if (path == null || path.length() == 0) { throw new AssertionError("ensureDirsExistInPath called with null or empty path."); } String dirPath = (path.charAt(path.length() - 1) == File.separatorChar) ? path.substring(0, path.length() - 1) : (new File(path)).getParent(); if (dirPath == null || knownExistingDirs.contains(dirPath)) { return; // known to exist } else { (new File(dirPath)).mkdirs(); knownExistingDirs.add(dirPath); } }
java
public static void ensureDirsExistInPath(String path) { if (path == null || path.length() == 0) { throw new AssertionError("ensureDirsExistInPath called with null or empty path."); } String dirPath = (path.charAt(path.length() - 1) == File.separatorChar) ? path.substring(0, path.length() - 1) : (new File(path)).getParent(); if (dirPath == null || knownExistingDirs.contains(dirPath)) { return; // known to exist } else { (new File(dirPath)).mkdirs(); knownExistingDirs.add(dirPath); } }
[ "public", "static", "void", "ensureDirsExistInPath", "(", "String", "path", ")", "{", "if", "(", "path", "==", "null", "||", "path", ".", "length", "(", ")", "==", "0", ")", "{", "throw", "new", "AssertionError", "(", "\"ensureDirsExistInPath called with null ...
Ensures that the directories in the given path exist, creating them if necessary. <p>Note: If the path does not end with the separator char (slash in Linux), then the name at the end is assumed to be the file name, so directories are only created down to its parent. @param path The path for which to ensure directories exist.
[ "Ensures", "that", "the", "directories", "in", "the", "given", "path", "exist", "creating", "them", "if", "necessary", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/base/internal/BaseUtils.java#L92-L108
train
google/closure-templates
java/src/com/google/template/soy/base/internal/BaseUtils.java
BaseUtils.extractPartAfterLastDot
public static String extractPartAfterLastDot(String dottedIdent) { int lastDotIndex = dottedIdent.lastIndexOf('.'); return (lastDotIndex == -1) ? dottedIdent : dottedIdent.substring(lastDotIndex + 1); }
java
public static String extractPartAfterLastDot(String dottedIdent) { int lastDotIndex = dottedIdent.lastIndexOf('.'); return (lastDotIndex == -1) ? dottedIdent : dottedIdent.substring(lastDotIndex + 1); }
[ "public", "static", "String", "extractPartAfterLastDot", "(", "String", "dottedIdent", ")", "{", "int", "lastDotIndex", "=", "dottedIdent", ".", "lastIndexOf", "(", "'", "'", ")", ";", "return", "(", "lastDotIndex", "==", "-", "1", ")", "?", "dottedIdent", "...
Gets the part after the last dot in a dotted identifier. If there are no dots, returns the whole input string. <p>Important: The input must be a dotted identifier. This is not checked.
[ "Gets", "the", "part", "after", "the", "last", "dot", "in", "a", "dotted", "identifier", ".", "If", "there", "are", "no", "dots", "returns", "the", "whole", "input", "string", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/base/internal/BaseUtils.java#L151-L154
train
google/closure-templates
java/src/com/google/template/soy/types/SoyType.java
SoyType.toProto
public final SoyTypeP toProto() { SoyTypeP local = protoDual; if (local == null) { SoyTypeP.Builder builder = SoyTypeP.newBuilder(); doToProto(builder); local = builder.build(); protoDual = local; } return local; }
java
public final SoyTypeP toProto() { SoyTypeP local = protoDual; if (local == null) { SoyTypeP.Builder builder = SoyTypeP.newBuilder(); doToProto(builder); local = builder.build(); protoDual = local; } return local; }
[ "public", "final", "SoyTypeP", "toProto", "(", ")", "{", "SoyTypeP", "local", "=", "protoDual", ";", "if", "(", "local", "==", "null", ")", "{", "SoyTypeP", ".", "Builder", "builder", "=", "SoyTypeP", ".", "newBuilder", "(", ")", ";", "doToProto", "(", ...
The type represented in proto format. For template metadata protos.
[ "The", "type", "represented", "in", "proto", "format", ".", "For", "template", "metadata", "protos", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/types/SoyType.java#L194-L203
train
google/closure-templates
java/src/com/google/template/soy/soytree/RawTextNode.java
RawTextNode.substringLocation
public SourceLocation substringLocation(int start, int end) { checkElementIndex(start, rawText.length(), "start"); checkArgument(start < end); checkArgument(end <= rawText.length()); if (offsets == null) { return getSourceLocation(); } return new SourceLocation( getSourceLocation().getFilePath(), offsets.getPoint(rawText, start), // source locations are inclusive, the end locations should point at the last character // in the string, whereas substring is usually specified exclusively, so subtract 1 to make // up the difference offsets.getPoint(rawText, end - 1)); }
java
public SourceLocation substringLocation(int start, int end) { checkElementIndex(start, rawText.length(), "start"); checkArgument(start < end); checkArgument(end <= rawText.length()); if (offsets == null) { return getSourceLocation(); } return new SourceLocation( getSourceLocation().getFilePath(), offsets.getPoint(rawText, start), // source locations are inclusive, the end locations should point at the last character // in the string, whereas substring is usually specified exclusively, so subtract 1 to make // up the difference offsets.getPoint(rawText, end - 1)); }
[ "public", "SourceLocation", "substringLocation", "(", "int", "start", ",", "int", "end", ")", "{", "checkElementIndex", "(", "start", ",", "rawText", ".", "length", "(", ")", ",", "\"start\"", ")", ";", "checkArgument", "(", "start", "<", "end", ")", ";", ...
Returns the source location of the given substring.
[ "Returns", "the", "source", "location", "of", "the", "given", "substring", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/soytree/RawTextNode.java#L151-L165
train
google/closure-templates
java/src/com/google/template/soy/parsepasses/contextautoesc/ContextualAutoescaper.java
ContextualAutoescaper.rewrite
public void rewrite( ImmutableList<SoyFileNode> sourceFiles, IdGenerator idGenerator, TemplateRegistry registry) { // Inferences collects all the typing decisions we make and escaping modes we choose. Inferences inferences = new Inferences(registry); // TODO(lukes): having a separation of inference and rewriting was important when we did // template cloning and derivation. Now that that is deleted we could combine these into a // single pass over the tree and delete the Inferences class which may simplify things. for (SoyFileNode file : sourceFiles) { for (TemplateNode templateNode : file.getChildren()) { try { // The author specifies the kind of SanitizedContent to produce, and thus the context in // which to escape. Context startContext = Context.getStartContextForContentKind( MoreObjects.firstNonNull( templateNode.getContentKind(), SanitizedContentKind.HTML)); InferenceEngine.inferTemplateEndContext( templateNode, startContext, inferences, errorReporter); } catch (SoyAutoescapeException e) { reportError(errorReporter, e); } } } if (errorReporter.hasErrors()) { return; } // Now that we know we don't fail with exceptions, apply the changes to the given files. Rewriter rewriter = new Rewriter(inferences, idGenerator, printDirectives); for (SoyFileNode file : sourceFiles) { rewriter.rewrite(file); } }
java
public void rewrite( ImmutableList<SoyFileNode> sourceFiles, IdGenerator idGenerator, TemplateRegistry registry) { // Inferences collects all the typing decisions we make and escaping modes we choose. Inferences inferences = new Inferences(registry); // TODO(lukes): having a separation of inference and rewriting was important when we did // template cloning and derivation. Now that that is deleted we could combine these into a // single pass over the tree and delete the Inferences class which may simplify things. for (SoyFileNode file : sourceFiles) { for (TemplateNode templateNode : file.getChildren()) { try { // The author specifies the kind of SanitizedContent to produce, and thus the context in // which to escape. Context startContext = Context.getStartContextForContentKind( MoreObjects.firstNonNull( templateNode.getContentKind(), SanitizedContentKind.HTML)); InferenceEngine.inferTemplateEndContext( templateNode, startContext, inferences, errorReporter); } catch (SoyAutoescapeException e) { reportError(errorReporter, e); } } } if (errorReporter.hasErrors()) { return; } // Now that we know we don't fail with exceptions, apply the changes to the given files. Rewriter rewriter = new Rewriter(inferences, idGenerator, printDirectives); for (SoyFileNode file : sourceFiles) { rewriter.rewrite(file); } }
[ "public", "void", "rewrite", "(", "ImmutableList", "<", "SoyFileNode", ">", "sourceFiles", ",", "IdGenerator", "idGenerator", ",", "TemplateRegistry", "registry", ")", "{", "// Inferences collects all the typing decisions we make and escaping modes we choose.", "Inferences", "i...
Rewrites the given Soy files so that dynamic output is properly escaped according to the context in which it appears. @param fileSet Modified in place. @return Extra templates which were derived from templates under fileSet and which must be compiled with fileSet to produce a correct output. See {@link DerivedTemplateUtils} for an explanation of these.
[ "Rewrites", "the", "given", "Soy", "files", "so", "that", "dynamic", "output", "is", "properly", "escaped", "according", "to", "the", "context", "in", "which", "it", "appears", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/parsepasses/contextautoesc/ContextualAutoescaper.java#L85-L118
train
google/closure-templates
java/src/com/google/template/soy/parsepasses/contextautoesc/ContextualAutoescaper.java
ContextualAutoescaper.reportError
private void reportError(ErrorReporter errorReporter, SoyAutoescapeException e) { // First, get to the root cause of the exception, and assemble an error message indicating // the full call stack that led to the failure. String message = "- " + e.getOriginalMessage(); while (e.getCause() instanceof SoyAutoescapeException) { e = (SoyAutoescapeException) e.getCause(); message += "\n- " + e.getMessage(); } errorReporter.report(e.getSourceLocation(), AUTOESCAPE_ERROR, message); }
java
private void reportError(ErrorReporter errorReporter, SoyAutoescapeException e) { // First, get to the root cause of the exception, and assemble an error message indicating // the full call stack that led to the failure. String message = "- " + e.getOriginalMessage(); while (e.getCause() instanceof SoyAutoescapeException) { e = (SoyAutoescapeException) e.getCause(); message += "\n- " + e.getMessage(); } errorReporter.report(e.getSourceLocation(), AUTOESCAPE_ERROR, message); }
[ "private", "void", "reportError", "(", "ErrorReporter", "errorReporter", ",", "SoyAutoescapeException", "e", ")", "{", "// First, get to the root cause of the exception, and assemble an error message indicating", "// the full call stack that led to the failure.", "String", "message", "...
Reports an autoescape exception.
[ "Reports", "an", "autoescape", "exception", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/parsepasses/contextautoesc/ContextualAutoescaper.java#L121-L130
train
google/closure-templates
java/src/com/google/template/soy/passes/htmlmatcher/HtmlMatcherAccumulatorNode.java
HtmlMatcherAccumulatorNode.accumulateActiveEdges
public void accumulateActiveEdges(ImmutableList<ActiveEdge> activeEdges) { for (ActiveEdge accEdge : activeEdges) { accEdge.getGraphNode().linkEdgeToNode(accEdge.getActiveEdge(), this); } }
java
public void accumulateActiveEdges(ImmutableList<ActiveEdge> activeEdges) { for (ActiveEdge accEdge : activeEdges) { accEdge.getGraphNode().linkEdgeToNode(accEdge.getActiveEdge(), this); } }
[ "public", "void", "accumulateActiveEdges", "(", "ImmutableList", "<", "ActiveEdge", ">", "activeEdges", ")", "{", "for", "(", "ActiveEdge", "accEdge", ":", "activeEdges", ")", "{", "accEdge", ".", "getGraphNode", "(", ")", ".", "linkEdgeToNode", "(", "accEdge", ...
Links the all the given active edges to this node. <p>This produces a many-to-one linkage in the HTML matcher graph. <p>Note that a {@link HtmlMatcherGraphNode} may occur in the list more than once, each time with a different active edge. For example, this Soy template body: <pre> &lt;span&gt; {if $cond1}Content1{/if} // No HTML tags in the If-block. &lt;/span&gt; </pre> will add two occurences of an {@link HtmlMatcherConditionNode} to the {@code activeEdges} list, one with a {@code TRUE} active edge, and one with a {@code FALSE} active edge. @param activeEdges the list of all active edges that will point to this {@link HtmlMatcherAccumulatorNode}. Note that a {@link HtmlMatcherGraphNode} may occur in the list more than once.
[ "Links", "the", "all", "the", "given", "active", "edges", "to", "this", "node", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/passes/htmlmatcher/HtmlMatcherAccumulatorNode.java#L82-L86
train
google/closure-templates
java/src/com/google/template/soy/soyparse/Tokens.java
Tokens.createSrcLoc
static SourceLocation createSrcLoc(String filePath, Token first, Token... rest) { int beginLine = first.beginLine; int beginColumn = first.beginColumn; int endLine = first.endLine; int endColumn = first.endColumn; for (Token next : rest) { checkArgument(startsLaterThan(next, beginLine, beginColumn)); checkArgument(endsLaterThan(next, endLine, endColumn)); endLine = next.endLine; endColumn = next.endColumn; } // this special case happens for completely empty files. if (beginLine == 0 && endLine == 0 && beginColumn == 0 && endColumn == 0) { return new SourceLocation(filePath); } return new SourceLocation(filePath, beginLine, beginColumn, endLine, endColumn); }
java
static SourceLocation createSrcLoc(String filePath, Token first, Token... rest) { int beginLine = first.beginLine; int beginColumn = first.beginColumn; int endLine = first.endLine; int endColumn = first.endColumn; for (Token next : rest) { checkArgument(startsLaterThan(next, beginLine, beginColumn)); checkArgument(endsLaterThan(next, endLine, endColumn)); endLine = next.endLine; endColumn = next.endColumn; } // this special case happens for completely empty files. if (beginLine == 0 && endLine == 0 && beginColumn == 0 && endColumn == 0) { return new SourceLocation(filePath); } return new SourceLocation(filePath, beginLine, beginColumn, endLine, endColumn); }
[ "static", "SourceLocation", "createSrcLoc", "(", "String", "filePath", ",", "Token", "first", ",", "Token", "...", "rest", ")", "{", "int", "beginLine", "=", "first", ".", "beginLine", ";", "int", "beginColumn", "=", "first", ".", "beginColumn", ";", "int", ...
Returns a source location for the given tokens. <p>All the provided tokens should be in strictly increasing order.
[ "Returns", "a", "source", "location", "for", "the", "given", "tokens", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/soyparse/Tokens.java#L31-L48
train
google/closure-templates
java/src/com/google/template/soy/soytree/TemplateRegistry.java
TemplateRegistry.getTemplates
public ImmutableList<TemplateMetadata> getTemplates(CallNode node) { if (node instanceof CallBasicNode) { String calleeName = ((CallBasicNode) node).getCalleeName(); TemplateMetadata template = basicTemplatesOrElementsMap.get(calleeName); return template == null ? ImmutableList.of() : ImmutableList.of(template); } else { String calleeName = ((CallDelegateNode) node).getDelCalleeName(); return delTemplateSelector.delTemplateNameToValues().get(calleeName); } }
java
public ImmutableList<TemplateMetadata> getTemplates(CallNode node) { if (node instanceof CallBasicNode) { String calleeName = ((CallBasicNode) node).getCalleeName(); TemplateMetadata template = basicTemplatesOrElementsMap.get(calleeName); return template == null ? ImmutableList.of() : ImmutableList.of(template); } else { String calleeName = ((CallDelegateNode) node).getDelCalleeName(); return delTemplateSelector.delTemplateNameToValues().get(calleeName); } }
[ "public", "ImmutableList", "<", "TemplateMetadata", ">", "getTemplates", "(", "CallNode", "node", ")", "{", "if", "(", "node", "instanceof", "CallBasicNode", ")", "{", "String", "calleeName", "=", "(", "(", "CallBasicNode", ")", "node", ")", ".", "getCalleeNam...
Look up possible targets for a call.
[ "Look", "up", "possible", "targets", "for", "a", "call", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/soytree/TemplateRegistry.java#L149-L158
train
google/closure-templates
java/src/com/google/template/soy/soytree/TemplateRegistry.java
TemplateRegistry.getCallContentKind
public Optional<SanitizedContentKind> getCallContentKind(CallNode node) { ImmutableList<TemplateMetadata> templateNodes = getTemplates(node); // For per-file compilation, we may not have any of the delegate templates in the compilation // unit. if (!templateNodes.isEmpty()) { return Optional.fromNullable(templateNodes.get(0).getContentKind()); } // The template node may be null if the template is being compiled in isolation. return Optional.absent(); }
java
public Optional<SanitizedContentKind> getCallContentKind(CallNode node) { ImmutableList<TemplateMetadata> templateNodes = getTemplates(node); // For per-file compilation, we may not have any of the delegate templates in the compilation // unit. if (!templateNodes.isEmpty()) { return Optional.fromNullable(templateNodes.get(0).getContentKind()); } // The template node may be null if the template is being compiled in isolation. return Optional.absent(); }
[ "public", "Optional", "<", "SanitizedContentKind", ">", "getCallContentKind", "(", "CallNode", "node", ")", "{", "ImmutableList", "<", "TemplateMetadata", ">", "templateNodes", "=", "getTemplates", "(", "node", ")", ";", "// For per-file compilation, we may not have any o...
Gets the content kind that a call results in. If used with delegate calls, the delegate templates must use strict autoescaping. This relies on the fact that all delegate calls must have the same kind when using strict autoescaping. This is enforced by CheckDelegatesPass. @param node The {@link CallBasicNode} or {@link CallDelegateNode}. @return The kind of content that the call results in.
[ "Gets", "the", "content", "kind", "that", "a", "call", "results", "in", ".", "If", "used", "with", "delegate", "calls", "the", "delegate", "templates", "must", "use", "strict", "autoescaping", ".", "This", "relies", "on", "the", "fact", "that", "all", "del...
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/soytree/TemplateRegistry.java#L200-L209
train
google/closure-templates
java/src/com/google/template/soy/soytree/TemplateMetadata.java
TemplateMetadata.fromTemplate
public static TemplateMetadata fromTemplate(TemplateNode template) { TemplateMetadata.Builder builder = builder() .setTemplateName(template.getTemplateName()) .setSourceLocation(template.getSourceLocation()) .setSoyFileKind(SoyFileKind.SRC) .setContentKind(template.getContentKind()) .setStrictHtml(template.isStrictHtml()) .setDelPackageName(template.getDelPackageName()) .setVisibility(template.getVisibility()) .setParameters(Parameter.directParametersFromTemplate(template)) .setDataAllCallSituations(DataAllCallSituation.fromTemplate(template)); switch (template.getKind()) { case TEMPLATE_BASIC_NODE: builder.setTemplateKind(Kind.BASIC); break; case TEMPLATE_DELEGATE_NODE: builder.setTemplateKind(Kind.DELTEMPLATE); TemplateDelegateNode deltemplate = (TemplateDelegateNode) template; builder.setDelTemplateName(deltemplate.getDelTemplateName()); builder.setDelTemplateVariant(deltemplate.getDelTemplateVariant()); break; case TEMPLATE_ELEMENT_NODE: builder.setTemplateKind(Kind.ELEMENT); break; default: throw new AssertionError("unexpected template kind: " + template.getKind()); } return builder.build(); }
java
public static TemplateMetadata fromTemplate(TemplateNode template) { TemplateMetadata.Builder builder = builder() .setTemplateName(template.getTemplateName()) .setSourceLocation(template.getSourceLocation()) .setSoyFileKind(SoyFileKind.SRC) .setContentKind(template.getContentKind()) .setStrictHtml(template.isStrictHtml()) .setDelPackageName(template.getDelPackageName()) .setVisibility(template.getVisibility()) .setParameters(Parameter.directParametersFromTemplate(template)) .setDataAllCallSituations(DataAllCallSituation.fromTemplate(template)); switch (template.getKind()) { case TEMPLATE_BASIC_NODE: builder.setTemplateKind(Kind.BASIC); break; case TEMPLATE_DELEGATE_NODE: builder.setTemplateKind(Kind.DELTEMPLATE); TemplateDelegateNode deltemplate = (TemplateDelegateNode) template; builder.setDelTemplateName(deltemplate.getDelTemplateName()); builder.setDelTemplateVariant(deltemplate.getDelTemplateVariant()); break; case TEMPLATE_ELEMENT_NODE: builder.setTemplateKind(Kind.ELEMENT); break; default: throw new AssertionError("unexpected template kind: " + template.getKind()); } return builder.build(); }
[ "public", "static", "TemplateMetadata", "fromTemplate", "(", "TemplateNode", "template", ")", "{", "TemplateMetadata", ".", "Builder", "builder", "=", "builder", "(", ")", ".", "setTemplateName", "(", "template", ".", "getTemplateName", "(", ")", ")", ".", "setS...
Builds a Template from a parsed TemplateNode.
[ "Builds", "a", "Template", "from", "a", "parsed", "TemplateNode", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/soytree/TemplateMetadata.java#L49-L78
train
google/closure-templates
java/src/com/google/template/soy/incrementaldomsrc/IncrementalDomGenCallCodeUtils.java
IncrementalDomGenCallCodeUtils.maybeWrapContent
@Override protected Expression maybeWrapContent( CodeChunk.Generator generator, CallParamContentNode node, Expression content) { SanitizedContentKind kind = node.getContentKind(); if (kind == SanitizedContentKind.HTML || kind == SanitizedContentKind.ATTRIBUTES) { return content; } return super.maybeWrapContent(generator, node, content); }
java
@Override protected Expression maybeWrapContent( CodeChunk.Generator generator, CallParamContentNode node, Expression content) { SanitizedContentKind kind = node.getContentKind(); if (kind == SanitizedContentKind.HTML || kind == SanitizedContentKind.ATTRIBUTES) { return content; } return super.maybeWrapContent(generator, node, content); }
[ "@", "Override", "protected", "Expression", "maybeWrapContent", "(", "CodeChunk", ".", "Generator", "generator", ",", "CallParamContentNode", "node", ",", "Expression", "content", ")", "{", "SanitizedContentKind", "kind", "=", "node", ".", "getContentKind", "(", ")"...
Never wrap contents as SanitizedContent if HTML or ATTRIBUTES.
[ "Never", "wrap", "contents", "as", "SanitizedContent", "if", "HTML", "or", "ATTRIBUTES", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/incrementaldomsrc/IncrementalDomGenCallCodeUtils.java#L43-L51
train
google/closure-templates
java/src/com/google/template/soy/jbcsrc/shared/CompiledTemplates.java
CompiledTemplates.getTemplateFactory
public CompiledTemplate.Factory getTemplateFactory(String name) { CompiledTemplate.Factory factory = getTemplateData(name).factory; if (factory == null) { throw new IllegalArgumentException("cannot get a factory for the private template: " + name); } return factory; }
java
public CompiledTemplate.Factory getTemplateFactory(String name) { CompiledTemplate.Factory factory = getTemplateData(name).factory; if (factory == null) { throw new IllegalArgumentException("cannot get a factory for the private template: " + name); } return factory; }
[ "public", "CompiledTemplate", ".", "Factory", "getTemplateFactory", "(", "String", "name", ")", "{", "CompiledTemplate", ".", "Factory", "factory", "=", "getTemplateData", "(", "name", ")", ".", "factory", ";", "if", "(", "factory", "==", "null", ")", "{", "...
Returns a factory for the given fully qualified template name.
[ "Returns", "a", "factory", "for", "the", "given", "fully", "qualified", "template", "name", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/shared/CompiledTemplates.java#L86-L92
train
google/closure-templates
java/src/com/google/template/soy/jbcsrc/shared/CompiledTemplates.java
CompiledTemplates.getTransitiveIjParamsForTemplate
public ImmutableSortedSet<String> getTransitiveIjParamsForTemplate(String templateName) { TemplateData templateData = getTemplateData(templateName); ImmutableSortedSet<String> transitiveIjParams = templateData.transitiveIjParams; // racy-lazy init pattern. We may calculate this more than once, but that is fine because each // time should calculate the same value. if (transitiveIjParams != null) { // early return, we already calculated this. return transitiveIjParams; } Set<TemplateData> all = new HashSet<>(); collectTransitiveCallees(templateData, all); ImmutableSortedSet.Builder<String> ijs = ImmutableSortedSet.naturalOrder(); for (TemplateData callee : all) { ijs.addAll(callee.injectedParams); } transitiveIjParams = ijs.build(); // save the results templateData.transitiveIjParams = transitiveIjParams; return transitiveIjParams; }
java
public ImmutableSortedSet<String> getTransitiveIjParamsForTemplate(String templateName) { TemplateData templateData = getTemplateData(templateName); ImmutableSortedSet<String> transitiveIjParams = templateData.transitiveIjParams; // racy-lazy init pattern. We may calculate this more than once, but that is fine because each // time should calculate the same value. if (transitiveIjParams != null) { // early return, we already calculated this. return transitiveIjParams; } Set<TemplateData> all = new HashSet<>(); collectTransitiveCallees(templateData, all); ImmutableSortedSet.Builder<String> ijs = ImmutableSortedSet.naturalOrder(); for (TemplateData callee : all) { ijs.addAll(callee.injectedParams); } transitiveIjParams = ijs.build(); // save the results templateData.transitiveIjParams = transitiveIjParams; return transitiveIjParams; }
[ "public", "ImmutableSortedSet", "<", "String", ">", "getTransitiveIjParamsForTemplate", "(", "String", "templateName", ")", "{", "TemplateData", "templateData", "=", "getTemplateData", "(", "templateName", ")", ";", "ImmutableSortedSet", "<", "String", ">", "transitiveI...
Returns the transitive closure of all the injected params that might be used by this template.
[ "Returns", "the", "transitive", "closure", "of", "all", "the", "injected", "params", "that", "might", "be", "used", "by", "this", "template", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/shared/CompiledTemplates.java#L104-L123
train
google/closure-templates
java/src/com/google/template/soy/basicdirectives/CleanHtmlDirective.java
CleanHtmlDirective.generateOptionalSafeTagsArg
private String generateOptionalSafeTagsArg(List<? extends TargetExpr> args) { String optionalSafeTagsArg = ""; if (!args.isEmpty()) { // TODO(msamuel): Instead of parsing generated JS, we should have a CheckArgumentsPass that // allows directives and functions to examine their input expressions prior to compilation and // relay the input file and line number to the template author along with an error message. Iterable<String> optionalSafeTagExprs = Iterables.transform(args, TargetExpr::getText); // Verify that all exprs are single-quoted valid OptionalSafeTags. for (String singleQuoted : optionalSafeTagExprs) { if (singleQuoted.length() < 2 || singleQuoted.charAt(0) != '\'' || singleQuoted.charAt(singleQuoted.length() - 1) != '\'') { throw new IllegalArgumentException( String.format( "The cleanHtml directive expects arguments to be tag name string " + "literals, such as 'span'. Encountered: %s", singleQuoted)); } String tagName = singleQuoted.substring(1, singleQuoted.length() - 1); OptionalSafeTag.fromTagName(tagName); // throws if invalid } optionalSafeTagsArg = ", [" + ARG_JOINER.join(optionalSafeTagExprs) + "]"; } return optionalSafeTagsArg; }
java
private String generateOptionalSafeTagsArg(List<? extends TargetExpr> args) { String optionalSafeTagsArg = ""; if (!args.isEmpty()) { // TODO(msamuel): Instead of parsing generated JS, we should have a CheckArgumentsPass that // allows directives and functions to examine their input expressions prior to compilation and // relay the input file and line number to the template author along with an error message. Iterable<String> optionalSafeTagExprs = Iterables.transform(args, TargetExpr::getText); // Verify that all exprs are single-quoted valid OptionalSafeTags. for (String singleQuoted : optionalSafeTagExprs) { if (singleQuoted.length() < 2 || singleQuoted.charAt(0) != '\'' || singleQuoted.charAt(singleQuoted.length() - 1) != '\'') { throw new IllegalArgumentException( String.format( "The cleanHtml directive expects arguments to be tag name string " + "literals, such as 'span'. Encountered: %s", singleQuoted)); } String tagName = singleQuoted.substring(1, singleQuoted.length() - 1); OptionalSafeTag.fromTagName(tagName); // throws if invalid } optionalSafeTagsArg = ", [" + ARG_JOINER.join(optionalSafeTagExprs) + "]"; } return optionalSafeTagsArg; }
[ "private", "String", "generateOptionalSafeTagsArg", "(", "List", "<", "?", "extends", "TargetExpr", ">", "args", ")", "{", "String", "optionalSafeTagsArg", "=", "\"\"", ";", "if", "(", "!", "args", ".", "isEmpty", "(", ")", ")", "{", "// TODO(msamuel): Instead...
Converts a list of TargetExpr's into a list of safe tags as an argument for the supported backends. This will iterate over the expressions, ensure they're valid safe tags, and convert them into an array of Strings. <p>The generated output is valid for JS and Python. Any other languages should reevaluate if they require changes. @param args A list of possible safe tags. @return A string containing the safe tags argument.
[ "Converts", "a", "list", "of", "TargetExpr", "s", "into", "a", "list", "of", "safe", "tags", "as", "an", "argument", "for", "the", "supported", "backends", ".", "This", "will", "iterate", "over", "the", "expressions", "ensure", "they", "re", "valid", "safe...
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/basicdirectives/CleanHtmlDirective.java#L165-L190
train
google/closure-templates
java/src/com/google/template/soy/jbcsrc/LazyClosureCompiler.java
LazyClosureCompiler.asRawTextOnly
private Optional<Expression> asRawTextOnly(String name, RenderUnitNode renderUnit) { StringBuilder builder = null; List<SoyNode> children = new ArrayList<>(renderUnit.getChildren()); for (int i = 0; i < children.size(); i++) { SoyNode child = children.get(i); if (child instanceof MsgHtmlTagNode) { // by the time MsgHtmlTagNodes hit the code generator the HtmlTagNode instances they wrap // have been desugared into RawTextNodes (and other things). children.addAll(i + 1, ((MsgHtmlTagNode) child).getChildren()); continue; } if (child instanceof RawTextNode) { if (builder == null) { builder = new StringBuilder(); } builder.append(((RawTextNode) child).getRawText()); } else { return Optional.absent(); } } SanitizedContentKind kind = renderUnit.getContentKind(); Expression value = constant(builder == null ? "" : builder.toString(), parentVariables); if (kind == null) { value = MethodRef.STRING_DATA_FOR_VALUE.invoke(value); } else { value = MethodRef.ORDAIN_AS_SAFE.invoke(value, constantSanitizedContentKindAsContentKind(kind)); } FieldRef staticField = parentVariables.addStaticField(name, value); return Optional.of(staticField.accessor()); }
java
private Optional<Expression> asRawTextOnly(String name, RenderUnitNode renderUnit) { StringBuilder builder = null; List<SoyNode> children = new ArrayList<>(renderUnit.getChildren()); for (int i = 0; i < children.size(); i++) { SoyNode child = children.get(i); if (child instanceof MsgHtmlTagNode) { // by the time MsgHtmlTagNodes hit the code generator the HtmlTagNode instances they wrap // have been desugared into RawTextNodes (and other things). children.addAll(i + 1, ((MsgHtmlTagNode) child).getChildren()); continue; } if (child instanceof RawTextNode) { if (builder == null) { builder = new StringBuilder(); } builder.append(((RawTextNode) child).getRawText()); } else { return Optional.absent(); } } SanitizedContentKind kind = renderUnit.getContentKind(); Expression value = constant(builder == null ? "" : builder.toString(), parentVariables); if (kind == null) { value = MethodRef.STRING_DATA_FOR_VALUE.invoke(value); } else { value = MethodRef.ORDAIN_AS_SAFE.invoke(value, constantSanitizedContentKindAsContentKind(kind)); } FieldRef staticField = parentVariables.addStaticField(name, value); return Optional.of(staticField.accessor()); }
[ "private", "Optional", "<", "Expression", ">", "asRawTextOnly", "(", "String", "name", ",", "RenderUnitNode", "renderUnit", ")", "{", "StringBuilder", "builder", "=", "null", ";", "List", "<", "SoyNode", ">", "children", "=", "new", "ArrayList", "<>", "(", "...
Returns an SoyValueProvider expression for the given RenderUnitNode if it is composed of only raw text.
[ "Returns", "an", "SoyValueProvider", "expression", "for", "the", "given", "RenderUnitNode", "if", "it", "is", "composed", "of", "only", "raw", "text", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/LazyClosureCompiler.java#L265-L297
train
google/closure-templates
java/src/com/google/template/soy/jbcsrc/restricted/BytecodeProducer.java
BytecodeProducer.gen
public final void gen(CodeBuilder adapter) { boolean shouldClearIsGeneratingBit = false; if (Flags.DEBUG && !isGenerating.get()) { isGenerating.set(true); shouldClearIsGeneratingBit = true; } try { if (location.isKnown()) { // These add entries to the line number tables that are associated with the current method. // The line number table is just a mapping of bytecode offset (aka 'pc') to line number, // http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.12 // It is used by the JVM to add source data to stack traces and by debuggers to highlight // source files. Label start = new Label(); adapter.mark(start); adapter.visitLineNumber(location.getBeginLine(), start); } doGen(adapter); if (location.isKnown()) { Label end = new Label(); adapter.mark(end); adapter.visitLineNumber(location.getEndLine(), end); } } finally { if (shouldClearIsGeneratingBit) { isGenerating.set(false); } } }
java
public final void gen(CodeBuilder adapter) { boolean shouldClearIsGeneratingBit = false; if (Flags.DEBUG && !isGenerating.get()) { isGenerating.set(true); shouldClearIsGeneratingBit = true; } try { if (location.isKnown()) { // These add entries to the line number tables that are associated with the current method. // The line number table is just a mapping of bytecode offset (aka 'pc') to line number, // http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.12 // It is used by the JVM to add source data to stack traces and by debuggers to highlight // source files. Label start = new Label(); adapter.mark(start); adapter.visitLineNumber(location.getBeginLine(), start); } doGen(adapter); if (location.isKnown()) { Label end = new Label(); adapter.mark(end); adapter.visitLineNumber(location.getEndLine(), end); } } finally { if (shouldClearIsGeneratingBit) { isGenerating.set(false); } } }
[ "public", "final", "void", "gen", "(", "CodeBuilder", "adapter", ")", "{", "boolean", "shouldClearIsGeneratingBit", "=", "false", ";", "if", "(", "Flags", ".", "DEBUG", "&&", "!", "isGenerating", ".", "get", "(", ")", ")", "{", "isGenerating", ".", "set", ...
Writes the bytecode to the adapter.
[ "Writes", "the", "bytecode", "to", "the", "adapter", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/BytecodeProducer.java#L72-L102
train
google/closure-templates
java/src/com/google/template/soy/shared/SoyGeneralOptions.java
SoyGeneralOptions.setCompileTimeGlobalsInternal
private void setCompileTimeGlobalsInternal( ImmutableMap<String, PrimitiveData> compileTimeGlobalsMap) { Preconditions.checkState(compileTimeGlobals == null, "Compile-time globals already set."); compileTimeGlobals = compileTimeGlobalsMap; }
java
private void setCompileTimeGlobalsInternal( ImmutableMap<String, PrimitiveData> compileTimeGlobalsMap) { Preconditions.checkState(compileTimeGlobals == null, "Compile-time globals already set."); compileTimeGlobals = compileTimeGlobalsMap; }
[ "private", "void", "setCompileTimeGlobalsInternal", "(", "ImmutableMap", "<", "String", ",", "PrimitiveData", ">", "compileTimeGlobalsMap", ")", "{", "Preconditions", ".", "checkState", "(", "compileTimeGlobals", "==", "null", ",", "\"Compile-time globals already set.\"", ...
Sets the map from compile-time global name to value using Soy primitive types. @param compileTimeGlobalsMap Map from compile-time global name to value.
[ "Sets", "the", "map", "from", "compile", "-", "time", "global", "name", "to", "value", "using", "Soy", "primitive", "types", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/shared/SoyGeneralOptions.java#L124-L128
train
google/closure-templates
java/src/com/google/template/soy/shared/SoyGeneralOptions.java
SoyGeneralOptions.setCompileTimeGlobals
public SoyGeneralOptions setCompileTimeGlobals(File compileTimeGlobalsFile) throws IOException { setCompileTimeGlobalsInternal( SoyUtils.parseCompileTimeGlobals(Files.asCharSource(compileTimeGlobalsFile, UTF_8))); return this; }
java
public SoyGeneralOptions setCompileTimeGlobals(File compileTimeGlobalsFile) throws IOException { setCompileTimeGlobalsInternal( SoyUtils.parseCompileTimeGlobals(Files.asCharSource(compileTimeGlobalsFile, UTF_8))); return this; }
[ "public", "SoyGeneralOptions", "setCompileTimeGlobals", "(", "File", "compileTimeGlobalsFile", ")", "throws", "IOException", "{", "setCompileTimeGlobalsInternal", "(", "SoyUtils", ".", "parseCompileTimeGlobals", "(", "Files", ".", "asCharSource", "(", "compileTimeGlobalsFile"...
Sets the file containing compile-time globals. <p>Each line of the file should have the format <pre> &lt;global_name&gt; = &lt;primitive_data&gt; </pre> where primitive_data is a valid Soy expression literal for a primitive type (null, boolean, integer, float, or string). Empty lines and lines beginning with "//" are ignored. The file should be encoded in UTF-8. <p>If you need to generate a file in this format from Java, consider using the utility {@code SoyUtils.generateCompileTimeGlobalsFile()}. @param compileTimeGlobalsFile The file containing compile-time globals. @throws IOException If there is an error reading the compile-time globals file.
[ "Sets", "the", "file", "containing", "compile", "-", "time", "globals", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/shared/SoyGeneralOptions.java#L149-L153
train
google/closure-templates
java/src/com/google/template/soy/shared/SoyGeneralOptions.java
SoyGeneralOptions.setCompileTimeGlobals
public SoyGeneralOptions setCompileTimeGlobals(URL compileTimeGlobalsResource) throws IOException { setCompileTimeGlobalsInternal( SoyUtils.parseCompileTimeGlobals( Resources.asCharSource(compileTimeGlobalsResource, UTF_8))); return this; }
java
public SoyGeneralOptions setCompileTimeGlobals(URL compileTimeGlobalsResource) throws IOException { setCompileTimeGlobalsInternal( SoyUtils.parseCompileTimeGlobals( Resources.asCharSource(compileTimeGlobalsResource, UTF_8))); return this; }
[ "public", "SoyGeneralOptions", "setCompileTimeGlobals", "(", "URL", "compileTimeGlobalsResource", ")", "throws", "IOException", "{", "setCompileTimeGlobalsInternal", "(", "SoyUtils", ".", "parseCompileTimeGlobals", "(", "Resources", ".", "asCharSource", "(", "compileTimeGloba...
Sets the resource file containing compile-time globals. <p>Each line of the file should have the format <pre> &lt;global_name&gt; = &lt;primitive_data&gt; </pre> where primitive_data is a valid Soy expression literal for a primitive type (null, boolean, integer, float, or string). Empty lines and lines beginning with "//" are ignored. The file should be encoded in UTF-8. <p>If you need to generate a file in this format from Java, consider using the utility {@code SoyUtils.generateCompileTimeGlobalsFile()}. @param compileTimeGlobalsResource The resource file containing compile-time globals. @throws IOException If there is an error reading the compile-time globals file.
[ "Sets", "the", "resource", "file", "containing", "compile", "-", "time", "globals", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/shared/SoyGeneralOptions.java#L174-L180
train
google/closure-templates
java/src/com/google/template/soy/soytree/HtmlAttributeNode.java
HtmlAttributeNode.getStaticContent
@Nullable public String getStaticContent() { if (!hasValue()) { return null; } HtmlAttributeValueNode attrValue = (HtmlAttributeValueNode) getChild(1); if (attrValue.numChildren() == 0) { return ""; } if (attrValue.numChildren() > 1) { return null; } StandaloneNode attrValueNode = attrValue.getChild(0); if (!(attrValueNode instanceof RawTextNode)) { return null; } return ((RawTextNode) attrValueNode).getRawText(); }
java
@Nullable public String getStaticContent() { if (!hasValue()) { return null; } HtmlAttributeValueNode attrValue = (HtmlAttributeValueNode) getChild(1); if (attrValue.numChildren() == 0) { return ""; } if (attrValue.numChildren() > 1) { return null; } StandaloneNode attrValueNode = attrValue.getChild(0); if (!(attrValueNode instanceof RawTextNode)) { return null; } return ((RawTextNode) attrValueNode).getRawText(); }
[ "@", "Nullable", "public", "String", "getStaticContent", "(", ")", "{", "if", "(", "!", "hasValue", "(", ")", ")", "{", "return", "null", ";", "}", "HtmlAttributeValueNode", "attrValue", "=", "(", "HtmlAttributeValueNode", ")", "getChild", "(", "1", ")", "...
Returns the static value, if one exists, or null otherwise.
[ "Returns", "the", "static", "value", "if", "one", "exists", "or", "null", "otherwise", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/soytree/HtmlAttributeNode.java#L55-L72
train
google/closure-templates
java/src/com/google/template/soy/internal/i18n/SoyBidiUtils.java
SoyBidiUtils.decodeBidiGlobalDirFromJsOptions
public static BidiGlobalDir decodeBidiGlobalDirFromJsOptions( int bidiGlobalDir, boolean useGoogIsRtlForBidiGlobalDir) { if (bidiGlobalDir == 0) { if (!useGoogIsRtlForBidiGlobalDir) { return null; } return BidiGlobalDir.forIsRtlCodeSnippet( GOOG_IS_RTL_CODE_SNIPPET, GOOG_IS_RTL_CODE_SNIPPET_NAMESPACE, SoyBackendKind.JS_SRC); } Preconditions.checkState( !useGoogIsRtlForBidiGlobalDir, "Must not specify both bidiGlobalDir and bidiGlobalDirIsRtlCodeSnippet."); Preconditions.checkArgument( bidiGlobalDir == 1 || bidiGlobalDir == -1, "If specified, bidiGlobalDir must be 1 for LTR or -1 for RTL."); return BidiGlobalDir.forStaticIsRtl(bidiGlobalDir < 0); }
java
public static BidiGlobalDir decodeBidiGlobalDirFromJsOptions( int bidiGlobalDir, boolean useGoogIsRtlForBidiGlobalDir) { if (bidiGlobalDir == 0) { if (!useGoogIsRtlForBidiGlobalDir) { return null; } return BidiGlobalDir.forIsRtlCodeSnippet( GOOG_IS_RTL_CODE_SNIPPET, GOOG_IS_RTL_CODE_SNIPPET_NAMESPACE, SoyBackendKind.JS_SRC); } Preconditions.checkState( !useGoogIsRtlForBidiGlobalDir, "Must not specify both bidiGlobalDir and bidiGlobalDirIsRtlCodeSnippet."); Preconditions.checkArgument( bidiGlobalDir == 1 || bidiGlobalDir == -1, "If specified, bidiGlobalDir must be 1 for LTR or -1 for RTL."); return BidiGlobalDir.forStaticIsRtl(bidiGlobalDir < 0); }
[ "public", "static", "BidiGlobalDir", "decodeBidiGlobalDirFromJsOptions", "(", "int", "bidiGlobalDir", ",", "boolean", "useGoogIsRtlForBidiGlobalDir", ")", "{", "if", "(", "bidiGlobalDir", "==", "0", ")", "{", "if", "(", "!", "useGoogIsRtlForBidiGlobalDir", ")", "{", ...
Decodes the bidi global directionality from the usual command line options used to specify it. Checks that at most one of the options was specified. @param bidiGlobalDir 1: ltr, -1: rtl, 0: unspecified. @param useGoogIsRtlForBidiGlobalDir Whether to determine the bidi global direction at template runtime by evaluating goog.i18n.bidi.IS_RTL. @return BidiGlobalDir object - or null if neither option was specified.
[ "Decodes", "the", "bidi", "global", "directionality", "from", "the", "usual", "command", "line", "options", "used", "to", "specify", "it", ".", "Checks", "that", "at", "most", "one", "of", "the", "options", "was", "specified", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/internal/i18n/SoyBidiUtils.java#L74-L90
train
google/closure-templates
java/src/com/google/template/soy/internal/i18n/SoyBidiUtils.java
SoyBidiUtils.decodeBidiGlobalDirFromPyOptions
public static BidiGlobalDir decodeBidiGlobalDirFromPyOptions(String bidiIsRtlFn) { if (bidiIsRtlFn == null || bidiIsRtlFn.isEmpty()) { return null; } int dotIndex = bidiIsRtlFn.lastIndexOf('.'); Preconditions.checkArgument( dotIndex > 0 && dotIndex < bidiIsRtlFn.length() - 1, "If specified a bidiIsRtlFn must include the module path to allow for proper importing."); // When importing the module, we'll using the constant name to avoid potential conflicts. String fnName = bidiIsRtlFn.substring(dotIndex + 1) + "()"; return BidiGlobalDir.forIsRtlCodeSnippet( IS_RTL_MODULE_ALIAS + '.' + fnName, null, SoyBackendKind.PYTHON_SRC); }
java
public static BidiGlobalDir decodeBidiGlobalDirFromPyOptions(String bidiIsRtlFn) { if (bidiIsRtlFn == null || bidiIsRtlFn.isEmpty()) { return null; } int dotIndex = bidiIsRtlFn.lastIndexOf('.'); Preconditions.checkArgument( dotIndex > 0 && dotIndex < bidiIsRtlFn.length() - 1, "If specified a bidiIsRtlFn must include the module path to allow for proper importing."); // When importing the module, we'll using the constant name to avoid potential conflicts. String fnName = bidiIsRtlFn.substring(dotIndex + 1) + "()"; return BidiGlobalDir.forIsRtlCodeSnippet( IS_RTL_MODULE_ALIAS + '.' + fnName, null, SoyBackendKind.PYTHON_SRC); }
[ "public", "static", "BidiGlobalDir", "decodeBidiGlobalDirFromPyOptions", "(", "String", "bidiIsRtlFn", ")", "{", "if", "(", "bidiIsRtlFn", "==", "null", "||", "bidiIsRtlFn", ".", "isEmpty", "(", ")", ")", "{", "return", "null", ";", "}", "int", "dotIndex", "="...
Decodes bidi global directionality from the Python bidiIsRtlFn command line option. @param bidiIsRtlFn The string containing the full module path and function name. @return BidiGlobalDir object - or null if the option was not specified.
[ "Decodes", "bidi", "global", "directionality", "from", "the", "Python", "bidiIsRtlFn", "command", "line", "option", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/internal/i18n/SoyBidiUtils.java#L98-L110
train
google/closure-templates
java/src/com/google/template/soy/sharedpasses/render/CountingFlushableAppendable.java
CountingFlushableAppendable.beforeBlock
@Override public void beforeBlock() { if (count > 0) { try { flush(); } catch (IOException e) { logger.log(Level.SEVERE, "Flush from soy failed", e); } } }
java
@Override public void beforeBlock() { if (count > 0) { try { flush(); } catch (IOException e) { logger.log(Level.SEVERE, "Flush from soy failed", e); } } }
[ "@", "Override", "public", "void", "beforeBlock", "(", ")", "{", "if", "(", "count", ">", "0", ")", "{", "try", "{", "flush", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "logger", ".", "log", "(", "Level", ".", "SEVERE", ",", ...
Soy is about to block on a future. Flush the output stream if there is anything to flush, so we use the time we are blocking to transfer as many bytes as possible.
[ "Soy", "is", "about", "to", "block", "on", "a", "future", ".", "Flush", "the", "output", "stream", "if", "there", "is", "anything", "to", "flush", "so", "we", "use", "the", "time", "we", "are", "blocking", "to", "transfer", "as", "many", "bytes", "as",...
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/sharedpasses/render/CountingFlushableAppendable.java#L79-L87
train
google/closure-templates
java/src/com/google/template/soy/shared/internal/DirectiveDigest.java
DirectiveDigest.updateNames
public void updateNames( List<String> escapeMapNames, List<String> matcherNames, List<String> filterNames) { // Store the names for this directive for use in building the helper function. escapesName = escapeMapVar >= 0 ? escapeMapNames.get(escapeMapVar) : null; matcherName = matcherVar >= 0 ? matcherNames.get(matcherVar) : null; filterName = filterVar >= 0 ? filterNames.get(filterVar) : null; }
java
public void updateNames( List<String> escapeMapNames, List<String> matcherNames, List<String> filterNames) { // Store the names for this directive for use in building the helper function. escapesName = escapeMapVar >= 0 ? escapeMapNames.get(escapeMapVar) : null; matcherName = matcherVar >= 0 ? matcherNames.get(matcherVar) : null; filterName = filterVar >= 0 ? filterNames.get(filterVar) : null; }
[ "public", "void", "updateNames", "(", "List", "<", "String", ">", "escapeMapNames", ",", "List", "<", "String", ">", "matcherNames", ",", "List", "<", "String", ">", "filterNames", ")", "{", "// Store the names for this directive for use in building the helper function....
Update the escaper, matcher, and filter names based on the supplied lists and indices. @param escapeMapNames The list of escape map names. @param matcherNames The list of matcher regex names. @param filterNames The list of filter regex names.
[ "Update", "the", "escaper", "matcher", "and", "filter", "names", "based", "on", "the", "supplied", "lists", "and", "indices", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/shared/internal/DirectiveDigest.java#L85-L91
train
google/closure-templates
java/src/com/google/template/soy/data/SanitizedContents.java
SanitizedContents.emptyString
public static SanitizedContent emptyString(ContentKind kind) { if (kind == ContentKind.TEXT) { return UnsanitizedString.create(""); } return SanitizedContent.create("", kind, Dir.NEUTRAL); // Empty string is neutral. }
java
public static SanitizedContent emptyString(ContentKind kind) { if (kind == ContentKind.TEXT) { return UnsanitizedString.create(""); } return SanitizedContent.create("", kind, Dir.NEUTRAL); // Empty string is neutral. }
[ "public", "static", "SanitizedContent", "emptyString", "(", "ContentKind", "kind", ")", "{", "if", "(", "kind", "==", "ContentKind", ".", "TEXT", ")", "{", "return", "UnsanitizedString", ".", "create", "(", "\"\"", ")", ";", "}", "return", "SanitizedContent", ...
Creates an empty string constant.
[ "Creates", "an", "empty", "string", "constant", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/SanitizedContents.java#L70-L75
train
google/closure-templates
java/src/com/google/template/soy/data/SanitizedContents.java
SanitizedContents.fromResource
public static SanitizedContent fromResource( Class<?> contextClass, String resourceName, Charset charset, ContentKind kind) throws IOException { pretendValidateResource(resourceName, kind); return SanitizedContent.create( Resources.toString(Resources.getResource(contextClass, resourceName), charset), kind, // Text resources are usually localized, so one might think that the locale direction should // be assumed for them. We do not do that because: // - We do not know the locale direction here. // - Some messages do not get translated. // - This method currently can't be used for text resources (see pretendValidateResource()). kind.getDefaultDir()); }
java
public static SanitizedContent fromResource( Class<?> contextClass, String resourceName, Charset charset, ContentKind kind) throws IOException { pretendValidateResource(resourceName, kind); return SanitizedContent.create( Resources.toString(Resources.getResource(contextClass, resourceName), charset), kind, // Text resources are usually localized, so one might think that the locale direction should // be assumed for them. We do not do that because: // - We do not know the locale direction here. // - Some messages do not get translated. // - This method currently can't be used for text resources (see pretendValidateResource()). kind.getDefaultDir()); }
[ "public", "static", "SanitizedContent", "fromResource", "(", "Class", "<", "?", ">", "contextClass", ",", "String", "resourceName", ",", "Charset", "charset", ",", "ContentKind", "kind", ")", "throws", "IOException", "{", "pretendValidateResource", "(", "resourceNam...
Loads assumed-safe content from a Java resource. <p>This performs ZERO VALIDATION of the data, and takes you on your word that the input is valid. We assume that resources should be safe because they are part of the binary, and therefore not attacker controlled, unless the source code is compromised (in which there's nothing we can do). @param contextClass Class relative to which to load the resource. @param resourceName The name of the resource, relative to the context class. @param charset The character set to use, usually Charsets.UTF_8. @param kind The content kind of the resource.
[ "Loads", "assumed", "-", "safe", "content", "from", "a", "Java", "resource", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/SanitizedContents.java#L140-L153
train
google/closure-templates
java/src/com/google/template/soy/data/SanitizedContents.java
SanitizedContents.constantUri
public static SanitizedContent constantUri(@CompileTimeConstant final String constant) { return fromConstant(constant, ContentKind.URI, Dir.LTR); }
java
public static SanitizedContent constantUri(@CompileTimeConstant final String constant) { return fromConstant(constant, ContentKind.URI, Dir.LTR); }
[ "public", "static", "SanitizedContent", "constantUri", "(", "@", "CompileTimeConstant", "final", "String", "constant", ")", "{", "return", "fromConstant", "(", "constant", ",", "ContentKind", ".", "URI", ",", "Dir", ".", "LTR", ")", ";", "}" ]
Wraps an assumed-safe URI constant. <p>This only accepts compile-time constants, based on the assumption that URLs that are controlled by the application (and not user input) are considered safe.
[ "Wraps", "an", "assumed", "-", "safe", "URI", "constant", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/SanitizedContents.java#L188-L190
train
google/closure-templates
java/src/com/google/template/soy/data/SanitizedContents.java
SanitizedContents.constantHtml
public static SanitizedContent constantHtml(@CompileTimeConstant final String constant) { return fromConstant(constant, ContentKind.HTML, null); }
java
public static SanitizedContent constantHtml(@CompileTimeConstant final String constant) { return fromConstant(constant, ContentKind.HTML, null); }
[ "public", "static", "SanitizedContent", "constantHtml", "(", "@", "CompileTimeConstant", "final", "String", "constant", ")", "{", "return", "fromConstant", "(", "constant", ",", "ContentKind", ".", "HTML", ",", "null", ")", ";", "}" ]
Wraps an assumed-safe constant string that specifies a safe, balanced, document fragment. <p>This only accepts compile-time constants, based on the assumption that HTML snippets that are controlled by the application (and not user input) are considered safe.
[ "Wraps", "an", "assumed", "-", "safe", "constant", "string", "that", "specifies", "a", "safe", "balanced", "document", "fragment", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/SanitizedContents.java#L198-L200
train
google/closure-templates
java/src/com/google/template/soy/data/SanitizedContents.java
SanitizedContents.constantAttributes
public static SanitizedContent constantAttributes(@CompileTimeConstant final String constant) { return fromConstant(constant, ContentKind.ATTRIBUTES, Dir.LTR); }
java
public static SanitizedContent constantAttributes(@CompileTimeConstant final String constant) { return fromConstant(constant, ContentKind.ATTRIBUTES, Dir.LTR); }
[ "public", "static", "SanitizedContent", "constantAttributes", "(", "@", "CompileTimeConstant", "final", "String", "constant", ")", "{", "return", "fromConstant", "(", "constant", ",", "ContentKind", ".", "ATTRIBUTES", ",", "Dir", ".", "LTR", ")", ";", "}" ]
Wraps an assumed-safe constant string that specifies an attribute. <p>This only accepts compile-time constants, based on the assumption that attributes that are controlled by the application (and not user input) are considered safe.
[ "Wraps", "an", "assumed", "-", "safe", "constant", "string", "that", "specifies", "an", "attribute", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/SanitizedContents.java#L208-L210
train
google/closure-templates
java/src/com/google/template/soy/data/SanitizedContents.java
SanitizedContents.constantCss
public static SanitizedContent constantCss(@CompileTimeConstant final String constant) { return fromConstant(constant, ContentKind.CSS, Dir.LTR); }
java
public static SanitizedContent constantCss(@CompileTimeConstant final String constant) { return fromConstant(constant, ContentKind.CSS, Dir.LTR); }
[ "public", "static", "SanitizedContent", "constantCss", "(", "@", "CompileTimeConstant", "final", "String", "constant", ")", "{", "return", "fromConstant", "(", "constant", ",", "ContentKind", ".", "CSS", ",", "Dir", ".", "LTR", ")", ";", "}" ]
Wraps an assumed-safe CSS constant. <p>This only accepts compile-time constants, based on the assumption that CSSes that are controlled by the application (and not user input) are considered safe.
[ "Wraps", "an", "assumed", "-", "safe", "CSS", "constant", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/SanitizedContents.java#L218-L220
train
google/closure-templates
java/src/com/google/template/soy/data/SanitizedContents.java
SanitizedContents.constantJs
public static SanitizedContent constantJs(@CompileTimeConstant final String constant) { return fromConstant(constant, ContentKind.JS, Dir.LTR); }
java
public static SanitizedContent constantJs(@CompileTimeConstant final String constant) { return fromConstant(constant, ContentKind.JS, Dir.LTR); }
[ "public", "static", "SanitizedContent", "constantJs", "(", "@", "CompileTimeConstant", "final", "String", "constant", ")", "{", "return", "fromConstant", "(", "constant", ",", "ContentKind", ".", "JS", ",", "Dir", ".", "LTR", ")", ";", "}" ]
Wraps an assumed-safe JS constant. <p>This only accepts compile-time constants, based on the assumption that scripts that are controlled by the application (and not user input) are considered safe.
[ "Wraps", "an", "assumed", "-", "safe", "JS", "constant", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/SanitizedContents.java#L228-L230
train
google/closure-templates
java/src/com/google/template/soy/data/SanitizedContents.java
SanitizedContents.constantTrustedResourceUri
public static SanitizedContent constantTrustedResourceUri( @CompileTimeConstant final String constant) { return fromConstant(constant, ContentKind.TRUSTED_RESOURCE_URI, Dir.LTR); }
java
public static SanitizedContent constantTrustedResourceUri( @CompileTimeConstant final String constant) { return fromConstant(constant, ContentKind.TRUSTED_RESOURCE_URI, Dir.LTR); }
[ "public", "static", "SanitizedContent", "constantTrustedResourceUri", "(", "@", "CompileTimeConstant", "final", "String", "constant", ")", "{", "return", "fromConstant", "(", "constant", ",", "ContentKind", ".", "TRUSTED_RESOURCE_URI", ",", "Dir", ".", "LTR", ")", "...
Wraps an assumed-safe trusted_resource_uri constant. <p>This only accepts compile-time constants, based on the assumption that trusted resource URIs that are controlled by the application (and not user input) are considered safe.
[ "Wraps", "an", "assumed", "-", "safe", "trusted_resource_uri", "constant", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/SanitizedContents.java#L238-L241
train
google/closure-templates
java/src/com/google/template/soy/data/SanitizedContents.java
SanitizedContents.numberJs
public static SanitizedContent numberJs(final long number) { return SanitizedContent.create(String.valueOf(number), ContentKind.JS); }
java
public static SanitizedContent numberJs(final long number) { return SanitizedContent.create(String.valueOf(number), ContentKind.JS); }
[ "public", "static", "SanitizedContent", "numberJs", "(", "final", "long", "number", ")", "{", "return", "SanitizedContent", ".", "create", "(", "String", ".", "valueOf", "(", "number", ")", ",", "ContentKind", ".", "JS", ")", ";", "}" ]
Creates JS from a number. <p>Soy prints numbers as floats and it wraps them in spaces. This is undesirable if the source code is presented to the user, e.g. in {@code <textarea>}. This function allows converting the number to JS which is then printed as is.
[ "Creates", "JS", "from", "a", "number", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/SanitizedContents.java#L250-L252
train
google/closure-templates
java/src/com/google/template/soy/data/SanitizedContents.java
SanitizedContents.pretendValidateResource
@VisibleForTesting static void pretendValidateResource(String resourceName, ContentKind kind) { int index = resourceName.lastIndexOf('.'); Preconditions.checkArgument( index >= 0, "Currently, we only validate resources with explicit extensions."); String fileExtension = resourceName.substring(index + 1).toLowerCase(); switch (kind) { case JS: Preconditions.checkArgument(fileExtension.equals("js")); break; case HTML: Preconditions.checkArgument(SAFE_HTML_FILE_EXTENSIONS.contains(fileExtension)); break; case CSS: Preconditions.checkArgument(fileExtension.equals("css")); break; default: throw new IllegalArgumentException("Don't know how to validate resources of kind " + kind); } }
java
@VisibleForTesting static void pretendValidateResource(String resourceName, ContentKind kind) { int index = resourceName.lastIndexOf('.'); Preconditions.checkArgument( index >= 0, "Currently, we only validate resources with explicit extensions."); String fileExtension = resourceName.substring(index + 1).toLowerCase(); switch (kind) { case JS: Preconditions.checkArgument(fileExtension.equals("js")); break; case HTML: Preconditions.checkArgument(SAFE_HTML_FILE_EXTENSIONS.contains(fileExtension)); break; case CSS: Preconditions.checkArgument(fileExtension.equals("css")); break; default: throw new IllegalArgumentException("Don't know how to validate resources of kind " + kind); } }
[ "@", "VisibleForTesting", "static", "void", "pretendValidateResource", "(", "String", "resourceName", ",", "ContentKind", "kind", ")", "{", "int", "index", "=", "resourceName", ".", "lastIndexOf", "(", "'", "'", ")", ";", "Preconditions", ".", "checkArgument", "...
Very basic but strict validation that the resource's extension matches the content kind. <p>In practice, this may be unnecessary, but it's always good to start out strict. This list can either be expanded as needed, or removed if too onerous.
[ "Very", "basic", "but", "strict", "validation", "that", "the", "resource", "s", "extension", "matches", "the", "content", "kind", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/SanitizedContents.java#L352-L372
train
google/closure-templates
java/src/com/google/template/soy/sharedpasses/render/RenderableThunk.java
RenderableThunk.doResolveOnto
void doResolveOnto(Appendable appendable) throws IOException { doRender(appendable); content = appendable.toString(); if (kind == null) { resolved = StringData.forValue(content); } else { resolved = UnsafeSanitizedContentOrdainer.ordainAsSafe(content, kind); } }
java
void doResolveOnto(Appendable appendable) throws IOException { doRender(appendable); content = appendable.toString(); if (kind == null) { resolved = StringData.forValue(content); } else { resolved = UnsafeSanitizedContentOrdainer.ordainAsSafe(content, kind); } }
[ "void", "doResolveOnto", "(", "Appendable", "appendable", ")", "throws", "IOException", "{", "doRender", "(", "appendable", ")", ";", "content", "=", "appendable", ".", "toString", "(", ")", ";", "if", "(", "kind", "==", "null", ")", "{", "resolved", "=", ...
Resolves the value by writing it to appendable @param appendable An Appendable that you can call toString on to get the appended value
[ "Resolves", "the", "value", "by", "writing", "it", "to", "appendable" ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/sharedpasses/render/RenderableThunk.java#L84-L92
train
google/closure-templates
java/src/com/google/template/soy/data/AbstractLoggingAdvisingAppendable.java
AbstractLoggingAdvisingAppendable.appendLoggingFunctionInvocation
@Override public final AbstractLoggingAdvisingAppendable appendLoggingFunctionInvocation( LoggingFunctionInvocation funCall, ImmutableList<Function<String, String>> escapers) throws IOException { if (!isLogOnly()) { doAppendLoggingFunctionInvocation(funCall, escapers); } return this; }
java
@Override public final AbstractLoggingAdvisingAppendable appendLoggingFunctionInvocation( LoggingFunctionInvocation funCall, ImmutableList<Function<String, String>> escapers) throws IOException { if (!isLogOnly()) { doAppendLoggingFunctionInvocation(funCall, escapers); } return this; }
[ "@", "Override", "public", "final", "AbstractLoggingAdvisingAppendable", "appendLoggingFunctionInvocation", "(", "LoggingFunctionInvocation", "funCall", ",", "ImmutableList", "<", "Function", "<", "String", ",", "String", ">", ">", "escapers", ")", "throws", "IOException"...
Called whenever a logging function is being rendered.
[ "Called", "whenever", "a", "logging", "function", "is", "being", "rendered", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/AbstractLoggingAdvisingAppendable.java#L72-L80
train
google/closure-templates
java/src/com/google/template/soy/jssrc/internal/GenJsCodeVisitorAssistantForMsgs.java
GenJsCodeVisitorAssistantForMsgs.generateMsgGroupVariable
public Expression generateMsgGroupVariable(MsgFallbackGroupNode node) { String tmpVarName = translationContext.nameGenerator().generateName("msg_s"); Expression msg; if (node.numChildren() == 1) { translationContext .soyToJsVariableMappings() .setIsPrimaryMsgInUse(node, Expression.LITERAL_TRUE); msg = generateSingleMsgVariable(node.getChild(0), tmpVarName); } else { // has fallbackmsg children msg = generateMsgGroupVariable(node, tmpVarName); } // handle escaping for (SoyPrintDirective printDirective : node.getEscapingDirectives()) { msg = SoyJsPluginUtils.applyDirective( msg, (SoyJsSrcPrintDirective) printDirective, /* args= */ ImmutableList.of(), node.getSourceLocation(), errorReporter); } return msg; }
java
public Expression generateMsgGroupVariable(MsgFallbackGroupNode node) { String tmpVarName = translationContext.nameGenerator().generateName("msg_s"); Expression msg; if (node.numChildren() == 1) { translationContext .soyToJsVariableMappings() .setIsPrimaryMsgInUse(node, Expression.LITERAL_TRUE); msg = generateSingleMsgVariable(node.getChild(0), tmpVarName); } else { // has fallbackmsg children msg = generateMsgGroupVariable(node, tmpVarName); } // handle escaping for (SoyPrintDirective printDirective : node.getEscapingDirectives()) { msg = SoyJsPluginUtils.applyDirective( msg, (SoyJsSrcPrintDirective) printDirective, /* args= */ ImmutableList.of(), node.getSourceLocation(), errorReporter); } return msg; }
[ "public", "Expression", "generateMsgGroupVariable", "(", "MsgFallbackGroupNode", "node", ")", "{", "String", "tmpVarName", "=", "translationContext", ".", "nameGenerator", "(", ")", ".", "generateName", "(", "\"msg_s\"", ")", ";", "Expression", "msg", ";", "if", "...
Returns a code chunk representing a translated variable. <p>Example: <pre> {msg desc="Link to help content."}Learn more{/msg} {msg desc="Tells user how to access a product." hidden="true"} Click &lt;a href="}{$url}"&gt;here&lt;/a&gt; to access {$productName}. {/msg} </pre> might return the following code chunk: <pre> /** @desc Link to help content. *{@literal /} var MSG_UNNAMED_9 = goog.getMsg('Learn more'); var msg_s9 = MSG_UNNAMED_9; /** @desc Tells user how to access a product. * @hidden *{@literal /} var MSG_UNNAMED_10 = goog.getMsg( 'Click {$startLink}here{$endLink} to access {$productName}.', {startLink: '&lt;a href="' + opt_data.url + '"&gt;', endLink: '&lt;/a&gt;', productName: opt_data.productName}); </pre>
[ "Returns", "a", "code", "chunk", "representing", "a", "translated", "variable", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/internal/GenJsCodeVisitorAssistantForMsgs.java#L157-L179
train
google/closure-templates
java/src/com/google/template/soy/jssrc/internal/GenJsCodeVisitorAssistantForMsgs.java
GenJsCodeVisitorAssistantForMsgs.buildGoogMsgVarNameHelper
private String buildGoogMsgVarNameHelper(MsgNode msgNode) { // NOTE: MSG_UNNAMED/MSG_EXTERNAL are a special tokens recognized by the jscompiler. MSG_UNNAMED // disables the default logic that requires all messages to be uniquely named. // and MSG_EXTERNAL causes the jscompiler to not extract these messages. String desiredName = jsSrcOptions.googMsgsAreExternal() ? "MSG_EXTERNAL_" + MsgUtils.computeMsgIdForDualFormat(msgNode) : "MSG_UNNAMED"; return translationContext.nameGenerator().generateName(desiredName); }
java
private String buildGoogMsgVarNameHelper(MsgNode msgNode) { // NOTE: MSG_UNNAMED/MSG_EXTERNAL are a special tokens recognized by the jscompiler. MSG_UNNAMED // disables the default logic that requires all messages to be uniquely named. // and MSG_EXTERNAL causes the jscompiler to not extract these messages. String desiredName = jsSrcOptions.googMsgsAreExternal() ? "MSG_EXTERNAL_" + MsgUtils.computeMsgIdForDualFormat(msgNode) : "MSG_UNNAMED"; return translationContext.nameGenerator().generateName(desiredName); }
[ "private", "String", "buildGoogMsgVarNameHelper", "(", "MsgNode", "msgNode", ")", "{", "// NOTE: MSG_UNNAMED/MSG_EXTERNAL are a special tokens recognized by the jscompiler. MSG_UNNAMED", "// disables the default logic that requires all messages to be uniquely named.", "// and MSG_EXTERNAL causes...
Builds the googMsgVarName for an MsgNode.
[ "Builds", "the", "googMsgVarName", "for", "an", "MsgNode", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/internal/GenJsCodeVisitorAssistantForMsgs.java#L265-L274
train
google/closure-templates
java/src/com/google/template/soy/jssrc/internal/GenJsCodeVisitorAssistantForMsgs.java
GenJsCodeVisitorAssistantForMsgs.genGoogMsgPlaceholder
protected Expression genGoogMsgPlaceholder(MsgPlaceholderNode msgPhNode) { List<Expression> contentChunks = new ArrayList<>(); for (StandaloneNode contentNode : msgPhNode.getChildren()) { if (contentNode instanceof MsgHtmlTagNode && !isComputableAsJsExprsVisitor.exec(contentNode)) { // This is a MsgHtmlTagNode that is not computable as JS expressions. Visit it to // generate code to define the 'htmlTag<n>' variable. visit(contentNode); contentChunks.add(id("htmlTag" + contentNode.getId())); } else if (contentNode instanceof CallNode) { // If the CallNode has any CallParamContentNode children that are not computable as JS // expressions, visit them to generate code to define their respective 'param<n>' variables. CallNode callNode = (CallNode) contentNode; for (CallParamNode grandchild : callNode.getChildren()) { if (grandchild instanceof CallParamContentNode && !isComputableAsJsExprsVisitor.exec(grandchild)) { visit(grandchild); } } Expression call = genCallCodeUtils.gen( callNode, templateAliases, translationContext, errorReporter, master.getExprTranslator()); contentChunks.add(call); } else { List<Expression> chunks = genJsExprsVisitor.exec(contentNode); contentChunks.add(CodeChunkUtils.concatChunks(chunks)); } } return CodeChunkUtils.concatChunks(contentChunks); }
java
protected Expression genGoogMsgPlaceholder(MsgPlaceholderNode msgPhNode) { List<Expression> contentChunks = new ArrayList<>(); for (StandaloneNode contentNode : msgPhNode.getChildren()) { if (contentNode instanceof MsgHtmlTagNode && !isComputableAsJsExprsVisitor.exec(contentNode)) { // This is a MsgHtmlTagNode that is not computable as JS expressions. Visit it to // generate code to define the 'htmlTag<n>' variable. visit(contentNode); contentChunks.add(id("htmlTag" + contentNode.getId())); } else if (contentNode instanceof CallNode) { // If the CallNode has any CallParamContentNode children that are not computable as JS // expressions, visit them to generate code to define their respective 'param<n>' variables. CallNode callNode = (CallNode) contentNode; for (CallParamNode grandchild : callNode.getChildren()) { if (grandchild instanceof CallParamContentNode && !isComputableAsJsExprsVisitor.exec(grandchild)) { visit(grandchild); } } Expression call = genCallCodeUtils.gen( callNode, templateAliases, translationContext, errorReporter, master.getExprTranslator()); contentChunks.add(call); } else { List<Expression> chunks = genJsExprsVisitor.exec(contentNode); contentChunks.add(CodeChunkUtils.concatChunks(chunks)); } } return CodeChunkUtils.concatChunks(contentChunks); }
[ "protected", "Expression", "genGoogMsgPlaceholder", "(", "MsgPlaceholderNode", "msgPhNode", ")", "{", "List", "<", "Expression", ">", "contentChunks", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "StandaloneNode", "contentNode", ":", "msgPhNode", ".",...
Returns a code chunk for the given placeholder node.
[ "Returns", "a", "code", "chunk", "for", "the", "given", "placeholder", "node", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/internal/GenJsCodeVisitorAssistantForMsgs.java#L544-L584
train
google/closure-templates
java/src/com/google/template/soy/passes/htmlmatcher/HtmlTagMatchingPass.java
HtmlTagMatchingPass.run
public void run(HtmlMatcherGraph htmlMatcherGraph) { if (!htmlMatcherGraph.getRootNode().isPresent()) { // Empty graph. return; } visit(htmlMatcherGraph.getRootNode().get()); for (HtmlTagNode tag : annotationMap.keySet()) { if (tag instanceof HtmlOpenTagNode) { HtmlOpenTagNode openTag = (HtmlOpenTagNode) tag; if (annotationMap.containsEntry(openTag, INVALID_NODE)) { if (annotationMap.get(openTag).size() == 1) { errorReporter.report( openTag.getSourceLocation(), makeSoyErrorKind(UNEXPECTED_OPEN_TAG_ALWAYS)); } else { errorReporter.report( openTag.getSourceLocation(), makeSoyErrorKind(UNEXPECTED_OPEN_TAG_SOMETIMES)); } } } } // Do not annotate in inCondition because if there are errors, the nodes will be annotated // in the parent pass. The reason this happens is when the condition node is not balanced // internally but balanced globally. if (!errorReporter.getErrors().isEmpty() && inCondition) { return; } for (HtmlTagNode openTag : annotationMap.keySet()) { for (Optional<HtmlTagNode> closeTag : annotationMap.get(openTag)) { if (closeTag.isPresent()) { openTag.addTagPair(closeTag.get()); closeTag.get().addTagPair(openTag); } } } }
java
public void run(HtmlMatcherGraph htmlMatcherGraph) { if (!htmlMatcherGraph.getRootNode().isPresent()) { // Empty graph. return; } visit(htmlMatcherGraph.getRootNode().get()); for (HtmlTagNode tag : annotationMap.keySet()) { if (tag instanceof HtmlOpenTagNode) { HtmlOpenTagNode openTag = (HtmlOpenTagNode) tag; if (annotationMap.containsEntry(openTag, INVALID_NODE)) { if (annotationMap.get(openTag).size() == 1) { errorReporter.report( openTag.getSourceLocation(), makeSoyErrorKind(UNEXPECTED_OPEN_TAG_ALWAYS)); } else { errorReporter.report( openTag.getSourceLocation(), makeSoyErrorKind(UNEXPECTED_OPEN_TAG_SOMETIMES)); } } } } // Do not annotate in inCondition because if there are errors, the nodes will be annotated // in the parent pass. The reason this happens is when the condition node is not balanced // internally but balanced globally. if (!errorReporter.getErrors().isEmpty() && inCondition) { return; } for (HtmlTagNode openTag : annotationMap.keySet()) { for (Optional<HtmlTagNode> closeTag : annotationMap.get(openTag)) { if (closeTag.isPresent()) { openTag.addTagPair(closeTag.get()); closeTag.get().addTagPair(openTag); } } } }
[ "public", "void", "run", "(", "HtmlMatcherGraph", "htmlMatcherGraph", ")", "{", "if", "(", "!", "htmlMatcherGraph", ".", "getRootNode", "(", ")", ".", "isPresent", "(", ")", ")", "{", "// Empty graph.", "return", ";", "}", "visit", "(", "htmlMatcherGraph", "...
Runs the HtmlTagMatchingPass. <p>The pass does the following: <ol> <li>Traverse the HTML matcher graph and create a set of open -> close tag matches <li>Rebalance the code paths, injecting synthetic close tags to balance optional open tags. Optional open tags are defined here: <a href="https://www.w3.org/TR/html5/syntax.html#optional-tags">https://www.w3.org/TR/html5/syntax.html#optional-tags</a>. <p>&ndash; <em>Note:</em> Block nodes (such as {@code {msg} or {let}}) are discretely rebalanced, annotated and error-checked. By definition, a block node must internally balance HTML tags. <li>Check for tag mismatch errors in the fully balanced code paths. <p>&ndash; Afterwards, annotate the open with the list of possible close tags, and the close tags with the list of possible open tags. </ol>
[ "Runs", "the", "HtmlTagMatchingPass", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/passes/htmlmatcher/HtmlTagMatchingPass.java#L177-L211
train
google/closure-templates
java/src/com/google/template/soy/passes/htmlmatcher/HtmlTagMatchingPass.java
HtmlTagMatchingPass.injectCloseTag
private void injectCloseTag( HtmlOpenTagNode optionalOpenTag, HtmlTagNode destinationTag, IdGenerator idGenerator) { StandaloneNode openTagCopy = optionalOpenTag.getTagName().getNode().copy(new CopyState()); HtmlCloseTagNode syntheticClose = new HtmlCloseTagNode( idGenerator.genId(), openTagCopy, optionalOpenTag.getSourceLocation(), TagExistence.SYNTHETIC); // If destination is null, then insert at the end of the template. if (destinationTag == null) { int i = optionalOpenTag.getParent().getChildren().size(); optionalOpenTag.getParent().addChild(i, syntheticClose); } else { // This inserts the synthetic close tag right before the open tag. ParentSoyNode<StandaloneNode> openTagParent = destinationTag.getParent(); int i = openTagParent.getChildIndex(destinationTag); openTagParent.addChild(i, syntheticClose); } annotationMap.put(optionalOpenTag, Optional.of(syntheticClose)); annotationMap.put(syntheticClose, Optional.of(optionalOpenTag)); }
java
private void injectCloseTag( HtmlOpenTagNode optionalOpenTag, HtmlTagNode destinationTag, IdGenerator idGenerator) { StandaloneNode openTagCopy = optionalOpenTag.getTagName().getNode().copy(new CopyState()); HtmlCloseTagNode syntheticClose = new HtmlCloseTagNode( idGenerator.genId(), openTagCopy, optionalOpenTag.getSourceLocation(), TagExistence.SYNTHETIC); // If destination is null, then insert at the end of the template. if (destinationTag == null) { int i = optionalOpenTag.getParent().getChildren().size(); optionalOpenTag.getParent().addChild(i, syntheticClose); } else { // This inserts the synthetic close tag right before the open tag. ParentSoyNode<StandaloneNode> openTagParent = destinationTag.getParent(); int i = openTagParent.getChildIndex(destinationTag); openTagParent.addChild(i, syntheticClose); } annotationMap.put(optionalOpenTag, Optional.of(syntheticClose)); annotationMap.put(syntheticClose, Optional.of(optionalOpenTag)); }
[ "private", "void", "injectCloseTag", "(", "HtmlOpenTagNode", "optionalOpenTag", ",", "HtmlTagNode", "destinationTag", ",", "IdGenerator", "idGenerator", ")", "{", "StandaloneNode", "openTagCopy", "=", "optionalOpenTag", ".", "getTagName", "(", ")", ".", "getNode", "("...
Rebalances HTML tags when necessary. <p>If an optional tag is encountered, inject a synthetic close tag right before the tag that performs the implicit close. For example, this HTML: <pre>{@code <ul> <li>List 1 <li>List 2 </ul> }</pre> <p>Will be rewritten to look like this logical HTML (note the addition of the {@code </li>} tags): <pre>{@code <ul> <li>List 1</li> <li>List 2</li> </ul> }</pre>
[ "Rebalances", "HTML", "tags", "when", "necessary", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/passes/htmlmatcher/HtmlTagMatchingPass.java#L236-L258
train
google/closure-templates
java/src/com/google/template/soy/passes/htmlmatcher/HtmlTagMatchingPass.java
HtmlTagMatchingPass.visit
private void visit( HtmlMatcherBlockNode blockNode, Map<Equivalence.Wrapper<ExprNode>, Boolean> exprValueMap, HtmlStack stack) { if (blockNode.getGraph().getRootNode().isPresent()) { new HtmlTagMatchingPass( errorReporter, idGenerator, false, stack.inForeignContent, blockNode.getParentBlockType()) .run(blockNode.getGraph()); } Optional<HtmlMatcherGraphNode> nextNode = blockNode.getNodeForEdgeKind(EdgeKind.TRUE_EDGE); if (nextNode.isPresent()) { visit(nextNode.get(), exprValueMap, stack); } else { checkUnusedTags(stack); } }
java
private void visit( HtmlMatcherBlockNode blockNode, Map<Equivalence.Wrapper<ExprNode>, Boolean> exprValueMap, HtmlStack stack) { if (blockNode.getGraph().getRootNode().isPresent()) { new HtmlTagMatchingPass( errorReporter, idGenerator, false, stack.inForeignContent, blockNode.getParentBlockType()) .run(blockNode.getGraph()); } Optional<HtmlMatcherGraphNode> nextNode = blockNode.getNodeForEdgeKind(EdgeKind.TRUE_EDGE); if (nextNode.isPresent()) { visit(nextNode.get(), exprValueMap, stack); } else { checkUnusedTags(stack); } }
[ "private", "void", "visit", "(", "HtmlMatcherBlockNode", "blockNode", ",", "Map", "<", "Equivalence", ".", "Wrapper", "<", "ExprNode", ">", ",", "Boolean", ">", "exprValueMap", ",", "HtmlStack", "stack", ")", "{", "if", "(", "blockNode", ".", "getGraph", "("...
Blocks must be internally balanced, but require knowing if they are in foreign content or not. Recursively run the tag matcher and throw away the result.
[ "Blocks", "must", "be", "internally", "balanced", "but", "require", "knowing", "if", "they", "are", "in", "foreign", "content", "or", "not", ".", "Recursively", "run", "the", "tag", "matcher", "and", "throw", "away", "the", "result", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/passes/htmlmatcher/HtmlTagMatchingPass.java#L360-L379
train
google/closure-templates
java/src/com/google/template/soy/passes/htmlmatcher/HtmlTagMatchingPass.java
HtmlTagMatchingPass.visit
private void visit( HtmlMatcherAccumulatorNode accNode, Map<Equivalence.Wrapper<ExprNode>, Boolean> exprValueMap, HtmlStack stack) { Optional<HtmlMatcherGraphNode> nextNode = accNode.getNodeForEdgeKind(EdgeKind.TRUE_EDGE); if (nextNode.isPresent()) { visit(nextNode.get(), exprValueMap, stack); } else { checkUnusedTags(stack); } }
java
private void visit( HtmlMatcherAccumulatorNode accNode, Map<Equivalence.Wrapper<ExprNode>, Boolean> exprValueMap, HtmlStack stack) { Optional<HtmlMatcherGraphNode> nextNode = accNode.getNodeForEdgeKind(EdgeKind.TRUE_EDGE); if (nextNode.isPresent()) { visit(nextNode.get(), exprValueMap, stack); } else { checkUnusedTags(stack); } }
[ "private", "void", "visit", "(", "HtmlMatcherAccumulatorNode", "accNode", ",", "Map", "<", "Equivalence", ".", "Wrapper", "<", "ExprNode", ">", ",", "Boolean", ">", "exprValueMap", ",", "HtmlStack", "stack", ")", "{", "Optional", "<", "HtmlMatcherGraphNode", ">"...
Accumulator nodes mostly work like HTMLMatcherTagNodes, but don't add any elements.
[ "Accumulator", "nodes", "mostly", "work", "like", "HTMLMatcherTagNodes", "but", "don", "t", "add", "any", "elements", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/passes/htmlmatcher/HtmlTagMatchingPass.java#L420-L430
train
google/closure-templates
java/src/com/google/template/soy/jbcsrc/restricted/SoyExpression.java
SoyExpression.asBoxedList
public static Expression asBoxedList(List<SoyExpression> items) { List<Expression> childExprs = new ArrayList<>(items.size()); for (SoyExpression child : items) { childExprs.add(child.box()); } return BytecodeUtils.asList(childExprs); }
java
public static Expression asBoxedList(List<SoyExpression> items) { List<Expression> childExprs = new ArrayList<>(items.size()); for (SoyExpression child : items) { childExprs.add(child.box()); } return BytecodeUtils.asList(childExprs); }
[ "public", "static", "Expression", "asBoxedList", "(", "List", "<", "SoyExpression", ">", "items", ")", "{", "List", "<", "Expression", ">", "childExprs", "=", "new", "ArrayList", "<>", "(", "items", ".", "size", "(", ")", ")", ";", "for", "(", "SoyExpres...
Returns an Expression that evaluates to a list containing all the items as boxed soy values.
[ "Returns", "an", "Expression", "that", "evaluates", "to", "a", "list", "containing", "all", "the", "items", "as", "boxed", "soy", "values", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/SoyExpression.java#L99-L105
train
google/closure-templates
java/src/com/google/template/soy/jbcsrc/restricted/SoyExpression.java
SoyExpression.doBox
private static void doBox(CodeBuilder adapter, SoyRuntimeType type) { if (type.isKnownSanitizedContent()) { FieldRef.enumReference( ContentKind.valueOf(((SanitizedType) type.soyType()).getContentKind().name())) .accessStaticUnchecked(adapter); MethodRef.ORDAIN_AS_SAFE.invokeUnchecked(adapter); } else if (type.isKnownString()) { MethodRef.STRING_DATA_FOR_VALUE.invokeUnchecked(adapter); } else if (type.isKnownListOrUnionOfLists()) { MethodRef.LIST_IMPL_FOR_PROVIDER_LIST.invokeUnchecked(adapter); } else if (type.isKnownLegacyObjectMapOrUnionOfMaps()) { FieldRef.enumReference(RuntimeMapTypeTracker.Type.LEGACY_OBJECT_MAP_OR_RECORD) .putUnchecked(adapter); MethodRef.DICT_IMPL_FOR_PROVIDER_MAP.invokeUnchecked(adapter); } else if (type.isKnownMapOrUnionOfMaps()) { MethodRef.MAP_IMPL_FOR_PROVIDER_MAP.invokeUnchecked(adapter); } else if (type.isKnownProtoOrUnionOfProtos()) { MethodRef.SOY_PROTO_VALUE_CREATE.invokeUnchecked(adapter); } else { throw new IllegalStateException("Can't box soy expression of type " + type); } }
java
private static void doBox(CodeBuilder adapter, SoyRuntimeType type) { if (type.isKnownSanitizedContent()) { FieldRef.enumReference( ContentKind.valueOf(((SanitizedType) type.soyType()).getContentKind().name())) .accessStaticUnchecked(adapter); MethodRef.ORDAIN_AS_SAFE.invokeUnchecked(adapter); } else if (type.isKnownString()) { MethodRef.STRING_DATA_FOR_VALUE.invokeUnchecked(adapter); } else if (type.isKnownListOrUnionOfLists()) { MethodRef.LIST_IMPL_FOR_PROVIDER_LIST.invokeUnchecked(adapter); } else if (type.isKnownLegacyObjectMapOrUnionOfMaps()) { FieldRef.enumReference(RuntimeMapTypeTracker.Type.LEGACY_OBJECT_MAP_OR_RECORD) .putUnchecked(adapter); MethodRef.DICT_IMPL_FOR_PROVIDER_MAP.invokeUnchecked(adapter); } else if (type.isKnownMapOrUnionOfMaps()) { MethodRef.MAP_IMPL_FOR_PROVIDER_MAP.invokeUnchecked(adapter); } else if (type.isKnownProtoOrUnionOfProtos()) { MethodRef.SOY_PROTO_VALUE_CREATE.invokeUnchecked(adapter); } else { throw new IllegalStateException("Can't box soy expression of type " + type); } }
[ "private", "static", "void", "doBox", "(", "CodeBuilder", "adapter", ",", "SoyRuntimeType", "type", ")", "{", "if", "(", "type", ".", "isKnownSanitizedContent", "(", ")", ")", "{", "FieldRef", ".", "enumReference", "(", "ContentKind", ".", "valueOf", "(", "(...
Generates code to box the expression assuming that it is non-nullable and on the top of the stack.
[ "Generates", "code", "to", "box", "the", "expression", "assuming", "that", "it", "is", "non", "-", "nullable", "and", "on", "the", "top", "of", "the", "stack", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/SoyExpression.java#L285-L306
train
google/closure-templates
java/src/com/google/template/soy/jbcsrc/restricted/SoyExpression.java
SoyExpression.coerceToBoolean
public SoyExpression coerceToBoolean() { // First deal with primitives which don't have to care about null. if (BytecodeUtils.isPrimitive(resultType())) { return coercePrimitiveToBoolean(); } if (soyType().equals(NullType.getInstance())) { return FALSE; } if (delegate.isNonNullable()) { return coerceNonNullableReferenceTypeToBoolean(); } else { // If we are potentially nullable, then map null to false and run the normal logic recursively // for the non-nullable branch. final Label end = new Label(); return withSource( new Expression(delegate.resultType(), delegate.features()) { @Override protected void doGen(CodeBuilder adapter) { delegate.gen(adapter); adapter.dup(); Label nonNull = new Label(); adapter.ifNonNull(nonNull); adapter.pop(); adapter.pushBoolean(false); adapter.goTo(end); adapter.mark(nonNull); } }) .asNonNullable() .coerceToBoolean() .labelEnd(end); } }
java
public SoyExpression coerceToBoolean() { // First deal with primitives which don't have to care about null. if (BytecodeUtils.isPrimitive(resultType())) { return coercePrimitiveToBoolean(); } if (soyType().equals(NullType.getInstance())) { return FALSE; } if (delegate.isNonNullable()) { return coerceNonNullableReferenceTypeToBoolean(); } else { // If we are potentially nullable, then map null to false and run the normal logic recursively // for the non-nullable branch. final Label end = new Label(); return withSource( new Expression(delegate.resultType(), delegate.features()) { @Override protected void doGen(CodeBuilder adapter) { delegate.gen(adapter); adapter.dup(); Label nonNull = new Label(); adapter.ifNonNull(nonNull); adapter.pop(); adapter.pushBoolean(false); adapter.goTo(end); adapter.mark(nonNull); } }) .asNonNullable() .coerceToBoolean() .labelEnd(end); } }
[ "public", "SoyExpression", "coerceToBoolean", "(", ")", "{", "// First deal with primitives which don't have to care about null.", "if", "(", "BytecodeUtils", ".", "isPrimitive", "(", "resultType", "(", ")", ")", ")", "{", "return", "coercePrimitiveToBoolean", "(", ")", ...
Coerce this expression to a boolean value.
[ "Coerce", "this", "expression", "to", "a", "boolean", "value", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/SoyExpression.java#L313-L345
train
google/closure-templates
java/src/com/google/template/soy/jbcsrc/restricted/SoyExpression.java
SoyExpression.coerceToString
public SoyExpression coerceToString() { if (soyRuntimeType.isKnownString() && !isBoxed()) { return this; } if (BytecodeUtils.isPrimitive(resultType())) { if (resultType().equals(Type.BOOLEAN_TYPE)) { return forString(MethodRef.BOOLEAN_TO_STRING.invoke(delegate)); } else if (resultType().equals(Type.DOUBLE_TYPE)) { return forString(MethodRef.DOUBLE_TO_STRING.invoke(delegate)); } else if (resultType().equals(Type.LONG_TYPE)) { return forString(MethodRef.LONG_TO_STRING.invoke(delegate)); } else { throw new AssertionError( "resultType(): " + resultType() + " is not a valid type for a SoyExpression"); } } if (!isBoxed()) { // this is for unboxed reference types (strings, lists, protos) String.valueOf handles null // implicitly return forString(MethodRef.STRING_VALUE_OF.invoke(delegate)); } return forString(MethodRef.RUNTIME_COERCE_TO_STRING.invoke(delegate)); }
java
public SoyExpression coerceToString() { if (soyRuntimeType.isKnownString() && !isBoxed()) { return this; } if (BytecodeUtils.isPrimitive(resultType())) { if (resultType().equals(Type.BOOLEAN_TYPE)) { return forString(MethodRef.BOOLEAN_TO_STRING.invoke(delegate)); } else if (resultType().equals(Type.DOUBLE_TYPE)) { return forString(MethodRef.DOUBLE_TO_STRING.invoke(delegate)); } else if (resultType().equals(Type.LONG_TYPE)) { return forString(MethodRef.LONG_TO_STRING.invoke(delegate)); } else { throw new AssertionError( "resultType(): " + resultType() + " is not a valid type for a SoyExpression"); } } if (!isBoxed()) { // this is for unboxed reference types (strings, lists, protos) String.valueOf handles null // implicitly return forString(MethodRef.STRING_VALUE_OF.invoke(delegate)); } return forString(MethodRef.RUNTIME_COERCE_TO_STRING.invoke(delegate)); }
[ "public", "SoyExpression", "coerceToString", "(", ")", "{", "if", "(", "soyRuntimeType", ".", "isKnownString", "(", ")", "&&", "!", "isBoxed", "(", ")", ")", "{", "return", "this", ";", "}", "if", "(", "BytecodeUtils", ".", "isPrimitive", "(", "resultType"...
Coerce this expression to a string value.
[ "Coerce", "this", "expression", "to", "a", "string", "value", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/SoyExpression.java#L383-L405
train
google/closure-templates
java/src/com/google/template/soy/jbcsrc/restricted/SoyExpression.java
SoyExpression.coerceToDouble
public SoyExpression coerceToDouble() { if (!isBoxed()) { if (soyRuntimeType.isKnownFloat()) { return this; } if (soyRuntimeType.isKnownInt()) { return forFloat(BytecodeUtils.numericConversion(delegate, Type.DOUBLE_TYPE)); } throw new UnsupportedOperationException("Can't convert " + resultType() + " to a double"); } if (soyRuntimeType.isKnownFloat()) { return forFloat(delegate.invoke(MethodRef.SOY_VALUE_FLOAT_VALUE)); } return forFloat(delegate.invoke(MethodRef.SOY_VALUE_NUMBER_VALUE)); }
java
public SoyExpression coerceToDouble() { if (!isBoxed()) { if (soyRuntimeType.isKnownFloat()) { return this; } if (soyRuntimeType.isKnownInt()) { return forFloat(BytecodeUtils.numericConversion(delegate, Type.DOUBLE_TYPE)); } throw new UnsupportedOperationException("Can't convert " + resultType() + " to a double"); } if (soyRuntimeType.isKnownFloat()) { return forFloat(delegate.invoke(MethodRef.SOY_VALUE_FLOAT_VALUE)); } return forFloat(delegate.invoke(MethodRef.SOY_VALUE_NUMBER_VALUE)); }
[ "public", "SoyExpression", "coerceToDouble", "(", ")", "{", "if", "(", "!", "isBoxed", "(", ")", ")", "{", "if", "(", "soyRuntimeType", ".", "isKnownFloat", "(", ")", ")", "{", "return", "this", ";", "}", "if", "(", "soyRuntimeType", ".", "isKnownInt", ...
Coerce this expression to a double value. Useful for float-int comparisons.
[ "Coerce", "this", "expression", "to", "a", "double", "value", ".", "Useful", "for", "float", "-", "int", "comparisons", "." ]
cc61e1dff70ae97f24f417a57410081bc498bd56
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/SoyExpression.java#L408-L422
train
liferay/com-liferay-commerce
commerce-price-list-api/src/main/java/com/liferay/commerce/price/list/service/CommercePriceListAccountRelLocalServiceUtil.java
CommercePriceListAccountRelLocalServiceUtil.getCommercePriceListAccountRel
public static com.liferay.commerce.price.list.model.CommercePriceListAccountRel getCommercePriceListAccountRel( long commercePriceListAccountRelId) throws com.liferay.portal.kernel.exception.PortalException { return getService() .getCommercePriceListAccountRel(commercePriceListAccountRelId); }
java
public static com.liferay.commerce.price.list.model.CommercePriceListAccountRel getCommercePriceListAccountRel( long commercePriceListAccountRelId) throws com.liferay.portal.kernel.exception.PortalException { return getService() .getCommercePriceListAccountRel(commercePriceListAccountRelId); }
[ "public", "static", "com", ".", "liferay", ".", "commerce", ".", "price", ".", "list", ".", "model", ".", "CommercePriceListAccountRel", "getCommercePriceListAccountRel", "(", "long", "commercePriceListAccountRelId", ")", "throws", "com", ".", "liferay", ".", "porta...
Returns the commerce price list account rel with the primary key. @param commercePriceListAccountRelId the primary key of the commerce price list account rel @return the commerce price list account rel @throws PortalException if a commerce price list account rel with the primary key could not be found
[ "Returns", "the", "commerce", "price", "list", "account", "rel", "with", "the", "primary", "key", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-api/src/main/java/com/liferay/commerce/price/list/service/CommercePriceListAccountRelLocalServiceUtil.java#L237-L242
train
liferay/com-liferay-commerce
commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/base/CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.java
CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.deleteCommerceNotificationTemplateUserSegmentRel
@Indexable(type = IndexableType.DELETE) @Override public CommerceNotificationTemplateUserSegmentRel deleteCommerceNotificationTemplateUserSegmentRel( long commerceNotificationTemplateUserSegmentRelId) throws PortalException { return commerceNotificationTemplateUserSegmentRelPersistence.remove(commerceNotificationTemplateUserSegmentRelId); }
java
@Indexable(type = IndexableType.DELETE) @Override public CommerceNotificationTemplateUserSegmentRel deleteCommerceNotificationTemplateUserSegmentRel( long commerceNotificationTemplateUserSegmentRelId) throws PortalException { return commerceNotificationTemplateUserSegmentRelPersistence.remove(commerceNotificationTemplateUserSegmentRelId); }
[ "@", "Indexable", "(", "type", "=", "IndexableType", ".", "DELETE", ")", "@", "Override", "public", "CommerceNotificationTemplateUserSegmentRel", "deleteCommerceNotificationTemplateUserSegmentRel", "(", "long", "commerceNotificationTemplateUserSegmentRelId", ")", "throws", "Por...
Deletes the commerce notification template user segment rel with the primary key from the database. Also notifies the appropriate model listeners. @param commerceNotificationTemplateUserSegmentRelId the primary key of the commerce notification template user segment rel @return the commerce notification template user segment rel that was removed @throws PortalException if a commerce notification template user segment rel with the primary key could not be found
[ "Deletes", "the", "commerce", "notification", "template", "user", "segment", "rel", "with", "the", "primary", "key", "from", "the", "database", ".", "Also", "notifies", "the", "appropriate", "model", "listeners", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/base/CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.java#L116-L122
train
liferay/com-liferay-commerce
commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/base/CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.java
CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.deleteCommerceNotificationTemplateUserSegmentRel
@Indexable(type = IndexableType.DELETE) @Override public CommerceNotificationTemplateUserSegmentRel deleteCommerceNotificationTemplateUserSegmentRel( CommerceNotificationTemplateUserSegmentRel commerceNotificationTemplateUserSegmentRel) { return commerceNotificationTemplateUserSegmentRelPersistence.remove(commerceNotificationTemplateUserSegmentRel); }
java
@Indexable(type = IndexableType.DELETE) @Override public CommerceNotificationTemplateUserSegmentRel deleteCommerceNotificationTemplateUserSegmentRel( CommerceNotificationTemplateUserSegmentRel commerceNotificationTemplateUserSegmentRel) { return commerceNotificationTemplateUserSegmentRelPersistence.remove(commerceNotificationTemplateUserSegmentRel); }
[ "@", "Indexable", "(", "type", "=", "IndexableType", ".", "DELETE", ")", "@", "Override", "public", "CommerceNotificationTemplateUserSegmentRel", "deleteCommerceNotificationTemplateUserSegmentRel", "(", "CommerceNotificationTemplateUserSegmentRel", "commerceNotificationTemplateUserSe...
Deletes the commerce notification template user segment rel from the database. Also notifies the appropriate model listeners. @param commerceNotificationTemplateUserSegmentRel the commerce notification template user segment rel @return the commerce notification template user segment rel that was removed
[ "Deletes", "the", "commerce", "notification", "template", "user", "segment", "rel", "from", "the", "database", ".", "Also", "notifies", "the", "appropriate", "model", "listeners", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/base/CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.java#L130-L135
train
liferay/com-liferay-commerce
commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/base/CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.java
CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.setCommerceNotificationAttachmentLocalService
public void setCommerceNotificationAttachmentLocalService( com.liferay.commerce.notification.service.CommerceNotificationAttachmentLocalService commerceNotificationAttachmentLocalService) { this.commerceNotificationAttachmentLocalService = commerceNotificationAttachmentLocalService; }
java
public void setCommerceNotificationAttachmentLocalService( com.liferay.commerce.notification.service.CommerceNotificationAttachmentLocalService commerceNotificationAttachmentLocalService) { this.commerceNotificationAttachmentLocalService = commerceNotificationAttachmentLocalService; }
[ "public", "void", "setCommerceNotificationAttachmentLocalService", "(", "com", ".", "liferay", ".", "commerce", ".", "notification", ".", "service", ".", "CommerceNotificationAttachmentLocalService", "commerceNotificationAttachmentLocalService", ")", "{", "this", ".", "commer...
Sets the commerce notification attachment local service. @param commerceNotificationAttachmentLocalService the commerce notification attachment local service
[ "Sets", "the", "commerce", "notification", "attachment", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/base/CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.java#L348-L351
train
liferay/com-liferay-commerce
commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/base/CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.java
CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.setCommerceNotificationQueueEntryLocalService
public void setCommerceNotificationQueueEntryLocalService( com.liferay.commerce.notification.service.CommerceNotificationQueueEntryLocalService commerceNotificationQueueEntryLocalService) { this.commerceNotificationQueueEntryLocalService = commerceNotificationQueueEntryLocalService; }
java
public void setCommerceNotificationQueueEntryLocalService( com.liferay.commerce.notification.service.CommerceNotificationQueueEntryLocalService commerceNotificationQueueEntryLocalService) { this.commerceNotificationQueueEntryLocalService = commerceNotificationQueueEntryLocalService; }
[ "public", "void", "setCommerceNotificationQueueEntryLocalService", "(", "com", ".", "liferay", ".", "commerce", ".", "notification", ".", "service", ".", "CommerceNotificationQueueEntryLocalService", "commerceNotificationQueueEntryLocalService", ")", "{", "this", ".", "commer...
Sets the commerce notification queue entry local service. @param commerceNotificationQueueEntryLocalService the commerce notification queue entry local service
[ "Sets", "the", "commerce", "notification", "queue", "entry", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/base/CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.java#L386-L389
train
liferay/com-liferay-commerce
commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/base/CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.java
CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.setCommerceNotificationTemplateLocalService
public void setCommerceNotificationTemplateLocalService( com.liferay.commerce.notification.service.CommerceNotificationTemplateLocalService commerceNotificationTemplateLocalService) { this.commerceNotificationTemplateLocalService = commerceNotificationTemplateLocalService; }
java
public void setCommerceNotificationTemplateLocalService( com.liferay.commerce.notification.service.CommerceNotificationTemplateLocalService commerceNotificationTemplateLocalService) { this.commerceNotificationTemplateLocalService = commerceNotificationTemplateLocalService; }
[ "public", "void", "setCommerceNotificationTemplateLocalService", "(", "com", ".", "liferay", ".", "commerce", ".", "notification", ".", "service", ".", "CommerceNotificationTemplateLocalService", "commerceNotificationTemplateLocalService", ")", "{", "this", ".", "commerceNoti...
Sets the commerce notification template local service. @param commerceNotificationTemplateLocalService the commerce notification template local service
[ "Sets", "the", "commerce", "notification", "template", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/base/CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.java#L424-L427
train
liferay/com-liferay-commerce
commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/base/CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.java
CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.setCounterLocalService
public void setCounterLocalService( com.liferay.counter.kernel.service.CounterLocalService counterLocalService) { this.counterLocalService = counterLocalService; }
java
public void setCounterLocalService( com.liferay.counter.kernel.service.CounterLocalService counterLocalService) { this.counterLocalService = counterLocalService; }
[ "public", "void", "setCounterLocalService", "(", "com", ".", "liferay", ".", "counter", ".", "kernel", ".", "service", ".", "CounterLocalService", "counterLocalService", ")", "{", "this", ".", "counterLocalService", "=", "counterLocalService", ";", "}" ]
Sets the counter local service. @param counterLocalService the counter local service
[ "Sets", "the", "counter", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/base/CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.java#L500-L503
train
liferay/com-liferay-commerce
commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/base/CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.java
CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.setClassNameLocalService
public void setClassNameLocalService( com.liferay.portal.kernel.service.ClassNameLocalService classNameLocalService) { this.classNameLocalService = classNameLocalService; }
java
public void setClassNameLocalService( com.liferay.portal.kernel.service.ClassNameLocalService classNameLocalService) { this.classNameLocalService = classNameLocalService; }
[ "public", "void", "setClassNameLocalService", "(", "com", ".", "liferay", ".", "portal", ".", "kernel", ".", "service", ".", "ClassNameLocalService", "classNameLocalService", ")", "{", "this", ".", "classNameLocalService", "=", "classNameLocalService", ";", "}" ]
Sets the class name local service. @param classNameLocalService the class name local service
[ "Sets", "the", "class", "name", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/base/CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.java#L519-L522
train
liferay/com-liferay-commerce
commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/base/CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.java
CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.setResourceLocalService
public void setResourceLocalService( com.liferay.portal.kernel.service.ResourceLocalService resourceLocalService) { this.resourceLocalService = resourceLocalService; }
java
public void setResourceLocalService( com.liferay.portal.kernel.service.ResourceLocalService resourceLocalService) { this.resourceLocalService = resourceLocalService; }
[ "public", "void", "setResourceLocalService", "(", "com", ".", "liferay", ".", "portal", ".", "kernel", ".", "service", ".", "ResourceLocalService", "resourceLocalService", ")", "{", "this", ".", "resourceLocalService", "=", "resourceLocalService", ";", "}" ]
Sets the resource local service. @param resourceLocalService the resource local service
[ "Sets", "the", "resource", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/base/CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.java#L557-L560
train
liferay/com-liferay-commerce
commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/base/CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.java
CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.setUserLocalService
public void setUserLocalService( com.liferay.portal.kernel.service.UserLocalService userLocalService) { this.userLocalService = userLocalService; }
java
public void setUserLocalService( com.liferay.portal.kernel.service.UserLocalService userLocalService) { this.userLocalService = userLocalService; }
[ "public", "void", "setUserLocalService", "(", "com", ".", "liferay", ".", "portal", ".", "kernel", ".", "service", ".", "UserLocalService", "userLocalService", ")", "{", "this", ".", "userLocalService", "=", "userLocalService", ";", "}" ]
Sets the user local service. @param userLocalService the user local service
[ "Sets", "the", "user", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/base/CommerceNotificationTemplateUserSegmentRelLocalServiceBaseImpl.java#L576-L579
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPAttachmentFileEntryLocalService
public void setCPAttachmentFileEntryLocalService( com.liferay.commerce.product.service.CPAttachmentFileEntryLocalService cpAttachmentFileEntryLocalService) { this.cpAttachmentFileEntryLocalService = cpAttachmentFileEntryLocalService; }
java
public void setCPAttachmentFileEntryLocalService( com.liferay.commerce.product.service.CPAttachmentFileEntryLocalService cpAttachmentFileEntryLocalService) { this.cpAttachmentFileEntryLocalService = cpAttachmentFileEntryLocalService; }
[ "public", "void", "setCPAttachmentFileEntryLocalService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPAttachmentFileEntryLocalService", "cpAttachmentFileEntryLocalService", ")", "{", "this", ".", "cpAttachmentFileEntryLocalService", ...
Sets the cp attachment file entry local service. @param cpAttachmentFileEntryLocalService the cp attachment file entry local service
[ "Sets", "the", "cp", "attachment", "file", "entry", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L92-L95
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPAttachmentFileEntryService
public void setCPAttachmentFileEntryService( com.liferay.commerce.product.service.CPAttachmentFileEntryService cpAttachmentFileEntryService) { this.cpAttachmentFileEntryService = cpAttachmentFileEntryService; }
java
public void setCPAttachmentFileEntryService( com.liferay.commerce.product.service.CPAttachmentFileEntryService cpAttachmentFileEntryService) { this.cpAttachmentFileEntryService = cpAttachmentFileEntryService; }
[ "public", "void", "setCPAttachmentFileEntryService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPAttachmentFileEntryService", "cpAttachmentFileEntryService", ")", "{", "this", ".", "cpAttachmentFileEntryService", "=", "cpAttachment...
Sets the cp attachment file entry remote service. @param cpAttachmentFileEntryService the cp attachment file entry remote service
[ "Sets", "the", "cp", "attachment", "file", "entry", "remote", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L111-L114
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPDefinitionLocalService
public void setCPDefinitionLocalService( com.liferay.commerce.product.service.CPDefinitionLocalService cpDefinitionLocalService) { this.cpDefinitionLocalService = cpDefinitionLocalService; }
java
public void setCPDefinitionLocalService( com.liferay.commerce.product.service.CPDefinitionLocalService cpDefinitionLocalService) { this.cpDefinitionLocalService = cpDefinitionLocalService; }
[ "public", "void", "setCPDefinitionLocalService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPDefinitionLocalService", "cpDefinitionLocalService", ")", "{", "this", ".", "cpDefinitionLocalService", "=", "cpDefinitionLocalService", ...
Sets the cp definition local service. @param cpDefinitionLocalService the cp definition local service
[ "Sets", "the", "cp", "definition", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L168-L171
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPDefinitionService
public void setCPDefinitionService( com.liferay.commerce.product.service.CPDefinitionService cpDefinitionService) { this.cpDefinitionService = cpDefinitionService; }
java
public void setCPDefinitionService( com.liferay.commerce.product.service.CPDefinitionService cpDefinitionService) { this.cpDefinitionService = cpDefinitionService; }
[ "public", "void", "setCPDefinitionService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPDefinitionService", "cpDefinitionService", ")", "{", "this", ".", "cpDefinitionService", "=", "cpDefinitionService", ";", "}" ]
Sets the cp definition remote service. @param cpDefinitionService the cp definition remote service
[ "Sets", "the", "cp", "definition", "remote", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L187-L190
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPDefinitionLinkLocalService
public void setCPDefinitionLinkLocalService( com.liferay.commerce.product.service.CPDefinitionLinkLocalService cpDefinitionLinkLocalService) { this.cpDefinitionLinkLocalService = cpDefinitionLinkLocalService; }
java
public void setCPDefinitionLinkLocalService( com.liferay.commerce.product.service.CPDefinitionLinkLocalService cpDefinitionLinkLocalService) { this.cpDefinitionLinkLocalService = cpDefinitionLinkLocalService; }
[ "public", "void", "setCPDefinitionLinkLocalService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPDefinitionLinkLocalService", "cpDefinitionLinkLocalService", ")", "{", "this", ".", "cpDefinitionLinkLocalService", "=", "cpDefinition...
Sets the cp definition link local service. @param cpDefinitionLinkLocalService the cp definition link local service
[ "Sets", "the", "cp", "definition", "link", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L243-L246
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPDefinitionLinkService
public void setCPDefinitionLinkService( com.liferay.commerce.product.service.CPDefinitionLinkService cpDefinitionLinkService) { this.cpDefinitionLinkService = cpDefinitionLinkService; }
java
public void setCPDefinitionLinkService( com.liferay.commerce.product.service.CPDefinitionLinkService cpDefinitionLinkService) { this.cpDefinitionLinkService = cpDefinitionLinkService; }
[ "public", "void", "setCPDefinitionLinkService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPDefinitionLinkService", "cpDefinitionLinkService", ")", "{", "this", ".", "cpDefinitionLinkService", "=", "cpDefinitionLinkService", ";",...
Sets the cp definition link remote service. @param cpDefinitionLinkService the cp definition link remote service
[ "Sets", "the", "cp", "definition", "link", "remote", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L262-L265
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPDefinitionOptionRelLocalService
public void setCPDefinitionOptionRelLocalService( com.liferay.commerce.product.service.CPDefinitionOptionRelLocalService cpDefinitionOptionRelLocalService) { this.cpDefinitionOptionRelLocalService = cpDefinitionOptionRelLocalService; }
java
public void setCPDefinitionOptionRelLocalService( com.liferay.commerce.product.service.CPDefinitionOptionRelLocalService cpDefinitionOptionRelLocalService) { this.cpDefinitionOptionRelLocalService = cpDefinitionOptionRelLocalService; }
[ "public", "void", "setCPDefinitionOptionRelLocalService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPDefinitionOptionRelLocalService", "cpDefinitionOptionRelLocalService", ")", "{", "this", ".", "cpDefinitionOptionRelLocalService", ...
Sets the cp definition option rel local service. @param cpDefinitionOptionRelLocalService the cp definition option rel local service
[ "Sets", "the", "cp", "definition", "option", "rel", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L319-L322
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPDefinitionOptionRelService
public void setCPDefinitionOptionRelService( com.liferay.commerce.product.service.CPDefinitionOptionRelService cpDefinitionOptionRelService) { this.cpDefinitionOptionRelService = cpDefinitionOptionRelService; }
java
public void setCPDefinitionOptionRelService( com.liferay.commerce.product.service.CPDefinitionOptionRelService cpDefinitionOptionRelService) { this.cpDefinitionOptionRelService = cpDefinitionOptionRelService; }
[ "public", "void", "setCPDefinitionOptionRelService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPDefinitionOptionRelService", "cpDefinitionOptionRelService", ")", "{", "this", ".", "cpDefinitionOptionRelService", "=", "cpDefinition...
Sets the cp definition option rel remote service. @param cpDefinitionOptionRelService the cp definition option rel remote service
[ "Sets", "the", "cp", "definition", "option", "rel", "remote", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L338-L341
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPDefinitionOptionValueRelLocalService
public void setCPDefinitionOptionValueRelLocalService( com.liferay.commerce.product.service.CPDefinitionOptionValueRelLocalService cpDefinitionOptionValueRelLocalService) { this.cpDefinitionOptionValueRelLocalService = cpDefinitionOptionValueRelLocalService; }
java
public void setCPDefinitionOptionValueRelLocalService( com.liferay.commerce.product.service.CPDefinitionOptionValueRelLocalService cpDefinitionOptionValueRelLocalService) { this.cpDefinitionOptionValueRelLocalService = cpDefinitionOptionValueRelLocalService; }
[ "public", "void", "setCPDefinitionOptionValueRelLocalService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPDefinitionOptionValueRelLocalService", "cpDefinitionOptionValueRelLocalService", ")", "{", "this", ".", "cpDefinitionOptionValue...
Sets the cp definition option value rel local service. @param cpDefinitionOptionValueRelLocalService the cp definition option value rel local service
[ "Sets", "the", "cp", "definition", "option", "value", "rel", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L376-L379
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPDefinitionOptionValueRelService
public void setCPDefinitionOptionValueRelService( com.liferay.commerce.product.service.CPDefinitionOptionValueRelService cpDefinitionOptionValueRelService) { this.cpDefinitionOptionValueRelService = cpDefinitionOptionValueRelService; }
java
public void setCPDefinitionOptionValueRelService( com.liferay.commerce.product.service.CPDefinitionOptionValueRelService cpDefinitionOptionValueRelService) { this.cpDefinitionOptionValueRelService = cpDefinitionOptionValueRelService; }
[ "public", "void", "setCPDefinitionOptionValueRelService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPDefinitionOptionValueRelService", "cpDefinitionOptionValueRelService", ")", "{", "this", ".", "cpDefinitionOptionValueRelService", ...
Sets the cp definition option value rel remote service. @param cpDefinitionOptionValueRelService the cp definition option value rel remote service
[ "Sets", "the", "cp", "definition", "option", "value", "rel", "remote", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L395-L398
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPDefinitionSpecificationOptionValueLocalService
public void setCPDefinitionSpecificationOptionValueLocalService( com.liferay.commerce.product.service.CPDefinitionSpecificationOptionValueLocalService cpDefinitionSpecificationOptionValueLocalService) { this.cpDefinitionSpecificationOptionValueLocalService = cpDefinitionSpecificationOptionValueLocalService; }
java
public void setCPDefinitionSpecificationOptionValueLocalService( com.liferay.commerce.product.service.CPDefinitionSpecificationOptionValueLocalService cpDefinitionSpecificationOptionValueLocalService) { this.cpDefinitionSpecificationOptionValueLocalService = cpDefinitionSpecificationOptionValueLocalService; }
[ "public", "void", "setCPDefinitionSpecificationOptionValueLocalService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPDefinitionSpecificationOptionValueLocalService", "cpDefinitionSpecificationOptionValueLocalService", ")", "{", "this", "...
Sets the cp definition specification option value local service. @param cpDefinitionSpecificationOptionValueLocalService the cp definition specification option value local service
[ "Sets", "the", "cp", "definition", "specification", "option", "value", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L433-L436
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPDefinitionSpecificationOptionValueService
public void setCPDefinitionSpecificationOptionValueService( com.liferay.commerce.product.service.CPDefinitionSpecificationOptionValueService cpDefinitionSpecificationOptionValueService) { this.cpDefinitionSpecificationOptionValueService = cpDefinitionSpecificationOptionValueService; }
java
public void setCPDefinitionSpecificationOptionValueService( com.liferay.commerce.product.service.CPDefinitionSpecificationOptionValueService cpDefinitionSpecificationOptionValueService) { this.cpDefinitionSpecificationOptionValueService = cpDefinitionSpecificationOptionValueService; }
[ "public", "void", "setCPDefinitionSpecificationOptionValueService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPDefinitionSpecificationOptionValueService", "cpDefinitionSpecificationOptionValueService", ")", "{", "this", ".", "cpDefini...
Sets the cp definition specification option value remote service. @param cpDefinitionSpecificationOptionValueService the cp definition specification option value remote service
[ "Sets", "the", "cp", "definition", "specification", "option", "value", "remote", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L452-L455
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPDisplayLayoutLocalService
public void setCPDisplayLayoutLocalService( com.liferay.commerce.product.service.CPDisplayLayoutLocalService cpDisplayLayoutLocalService) { this.cpDisplayLayoutLocalService = cpDisplayLayoutLocalService; }
java
public void setCPDisplayLayoutLocalService( com.liferay.commerce.product.service.CPDisplayLayoutLocalService cpDisplayLayoutLocalService) { this.cpDisplayLayoutLocalService = cpDisplayLayoutLocalService; }
[ "public", "void", "setCPDisplayLayoutLocalService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPDisplayLayoutLocalService", "cpDisplayLayoutLocalService", ")", "{", "this", ".", "cpDisplayLayoutLocalService", "=", "cpDisplayLayoutL...
Sets the cp display layout local service. @param cpDisplayLayoutLocalService the cp display layout local service
[ "Sets", "the", "cp", "display", "layout", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L490-L493
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPFriendlyURLEntryLocalService
public void setCPFriendlyURLEntryLocalService( com.liferay.commerce.product.service.CPFriendlyURLEntryLocalService cpFriendlyURLEntryLocalService) { this.cpFriendlyURLEntryLocalService = cpFriendlyURLEntryLocalService; }
java
public void setCPFriendlyURLEntryLocalService( com.liferay.commerce.product.service.CPFriendlyURLEntryLocalService cpFriendlyURLEntryLocalService) { this.cpFriendlyURLEntryLocalService = cpFriendlyURLEntryLocalService; }
[ "public", "void", "setCPFriendlyURLEntryLocalService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPFriendlyURLEntryLocalService", "cpFriendlyURLEntryLocalService", ")", "{", "this", ".", "cpFriendlyURLEntryLocalService", "=", "cpFr...
Sets the cp friendly url entry local service. @param cpFriendlyURLEntryLocalService the cp friendly url entry local service
[ "Sets", "the", "cp", "friendly", "url", "entry", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L528-L531
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPInstanceLocalService
public void setCPInstanceLocalService( com.liferay.commerce.product.service.CPInstanceLocalService cpInstanceLocalService) { this.cpInstanceLocalService = cpInstanceLocalService; }
java
public void setCPInstanceLocalService( com.liferay.commerce.product.service.CPInstanceLocalService cpInstanceLocalService) { this.cpInstanceLocalService = cpInstanceLocalService; }
[ "public", "void", "setCPInstanceLocalService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPInstanceLocalService", "cpInstanceLocalService", ")", "{", "this", ".", "cpInstanceLocalService", "=", "cpInstanceLocalService", ";", "}...
Sets the cp instance local service. @param cpInstanceLocalService the cp instance local service
[ "Sets", "the", "cp", "instance", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L566-L569
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPInstanceService
public void setCPInstanceService( com.liferay.commerce.product.service.CPInstanceService cpInstanceService) { this.cpInstanceService = cpInstanceService; }
java
public void setCPInstanceService( com.liferay.commerce.product.service.CPInstanceService cpInstanceService) { this.cpInstanceService = cpInstanceService; }
[ "public", "void", "setCPInstanceService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPInstanceService", "cpInstanceService", ")", "{", "this", ".", "cpInstanceService", "=", "cpInstanceService", ";", "}" ]
Sets the cp instance remote service. @param cpInstanceService the cp instance remote service
[ "Sets", "the", "cp", "instance", "remote", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L585-L588
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPMeasurementUnitLocalService
public void setCPMeasurementUnitLocalService( com.liferay.commerce.product.service.CPMeasurementUnitLocalService cpMeasurementUnitLocalService) { this.cpMeasurementUnitLocalService = cpMeasurementUnitLocalService; }
java
public void setCPMeasurementUnitLocalService( com.liferay.commerce.product.service.CPMeasurementUnitLocalService cpMeasurementUnitLocalService) { this.cpMeasurementUnitLocalService = cpMeasurementUnitLocalService; }
[ "public", "void", "setCPMeasurementUnitLocalService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPMeasurementUnitLocalService", "cpMeasurementUnitLocalService", ")", "{", "this", ".", "cpMeasurementUnitLocalService", "=", "cpMeasur...
Sets the cp measurement unit local service. @param cpMeasurementUnitLocalService the cp measurement unit local service
[ "Sets", "the", "cp", "measurement", "unit", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L641-L644
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPMeasurementUnitService
public void setCPMeasurementUnitService( com.liferay.commerce.product.service.CPMeasurementUnitService cpMeasurementUnitService) { this.cpMeasurementUnitService = cpMeasurementUnitService; }
java
public void setCPMeasurementUnitService( com.liferay.commerce.product.service.CPMeasurementUnitService cpMeasurementUnitService) { this.cpMeasurementUnitService = cpMeasurementUnitService; }
[ "public", "void", "setCPMeasurementUnitService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPMeasurementUnitService", "cpMeasurementUnitService", ")", "{", "this", ".", "cpMeasurementUnitService", "=", "cpMeasurementUnitService", ...
Sets the cp measurement unit remote service. @param cpMeasurementUnitService the cp measurement unit remote service
[ "Sets", "the", "cp", "measurement", "unit", "remote", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L660-L663
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPOptionLocalService
public void setCPOptionLocalService( com.liferay.commerce.product.service.CPOptionLocalService cpOptionLocalService) { this.cpOptionLocalService = cpOptionLocalService; }
java
public void setCPOptionLocalService( com.liferay.commerce.product.service.CPOptionLocalService cpOptionLocalService) { this.cpOptionLocalService = cpOptionLocalService; }
[ "public", "void", "setCPOptionLocalService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPOptionLocalService", "cpOptionLocalService", ")", "{", "this", ".", "cpOptionLocalService", "=", "cpOptionLocalService", ";", "}" ]
Sets the cp option local service. @param cpOptionLocalService the cp option local service
[ "Sets", "the", "cp", "option", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L698-L701
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPOptionService
public void setCPOptionService( com.liferay.commerce.product.service.CPOptionService cpOptionService) { this.cpOptionService = cpOptionService; }
java
public void setCPOptionService( com.liferay.commerce.product.service.CPOptionService cpOptionService) { this.cpOptionService = cpOptionService; }
[ "public", "void", "setCPOptionService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPOptionService", "cpOptionService", ")", "{", "this", ".", "cpOptionService", "=", "cpOptionService", ";", "}" ]
Sets the cp option remote service. @param cpOptionService the cp option remote service
[ "Sets", "the", "cp", "option", "remote", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L717-L720
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPOptionCategoryLocalService
public void setCPOptionCategoryLocalService( com.liferay.commerce.product.service.CPOptionCategoryLocalService cpOptionCategoryLocalService) { this.cpOptionCategoryLocalService = cpOptionCategoryLocalService; }
java
public void setCPOptionCategoryLocalService( com.liferay.commerce.product.service.CPOptionCategoryLocalService cpOptionCategoryLocalService) { this.cpOptionCategoryLocalService = cpOptionCategoryLocalService; }
[ "public", "void", "setCPOptionCategoryLocalService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPOptionCategoryLocalService", "cpOptionCategoryLocalService", ")", "{", "this", ".", "cpOptionCategoryLocalService", "=", "cpOptionCate...
Sets the cp option category local service. @param cpOptionCategoryLocalService the cp option category local service
[ "Sets", "the", "cp", "option", "category", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L754-L757
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPOptionCategoryService
public void setCPOptionCategoryService( com.liferay.commerce.product.service.CPOptionCategoryService cpOptionCategoryService) { this.cpOptionCategoryService = cpOptionCategoryService; }
java
public void setCPOptionCategoryService( com.liferay.commerce.product.service.CPOptionCategoryService cpOptionCategoryService) { this.cpOptionCategoryService = cpOptionCategoryService; }
[ "public", "void", "setCPOptionCategoryService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPOptionCategoryService", "cpOptionCategoryService", ")", "{", "this", ".", "cpOptionCategoryService", "=", "cpOptionCategoryService", ";",...
Sets the cp option category remote service. @param cpOptionCategoryService the cp option category remote service
[ "Sets", "the", "cp", "option", "category", "remote", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L773-L776
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPOptionValueLocalService
public void setCPOptionValueLocalService( com.liferay.commerce.product.service.CPOptionValueLocalService cpOptionValueLocalService) { this.cpOptionValueLocalService = cpOptionValueLocalService; }
java
public void setCPOptionValueLocalService( com.liferay.commerce.product.service.CPOptionValueLocalService cpOptionValueLocalService) { this.cpOptionValueLocalService = cpOptionValueLocalService; }
[ "public", "void", "setCPOptionValueLocalService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPOptionValueLocalService", "cpOptionValueLocalService", ")", "{", "this", ".", "cpOptionValueLocalService", "=", "cpOptionValueLocalServic...
Sets the cp option value local service. @param cpOptionValueLocalService the cp option value local service
[ "Sets", "the", "cp", "option", "value", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L811-L814
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPOptionValueService
public void setCPOptionValueService( com.liferay.commerce.product.service.CPOptionValueService cpOptionValueService) { this.cpOptionValueService = cpOptionValueService; }
java
public void setCPOptionValueService( com.liferay.commerce.product.service.CPOptionValueService cpOptionValueService) { this.cpOptionValueService = cpOptionValueService; }
[ "public", "void", "setCPOptionValueService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPOptionValueService", "cpOptionValueService", ")", "{", "this", ".", "cpOptionValueService", "=", "cpOptionValueService", ";", "}" ]
Sets the cp option value remote service. @param cpOptionValueService the cp option value remote service
[ "Sets", "the", "cp", "option", "value", "remote", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L830-L833
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCProductLocalService
public void setCProductLocalService( com.liferay.commerce.product.service.CProductLocalService cProductLocalService) { this.cProductLocalService = cProductLocalService; }
java
public void setCProductLocalService( com.liferay.commerce.product.service.CProductLocalService cProductLocalService) { this.cProductLocalService = cProductLocalService; }
[ "public", "void", "setCProductLocalService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CProductLocalService", "cProductLocalService", ")", "{", "this", ".", "cProductLocalService", "=", "cProductLocalService", ";", "}" ]
Sets the c product local service. @param cProductLocalService the c product local service
[ "Sets", "the", "c", "product", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L868-L871
train
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java
CPTaxCategoryServiceBaseImpl.setCPRuleLocalService
public void setCPRuleLocalService( com.liferay.commerce.product.service.CPRuleLocalService cpRuleLocalService) { this.cpRuleLocalService = cpRuleLocalService; }
java
public void setCPRuleLocalService( com.liferay.commerce.product.service.CPRuleLocalService cpRuleLocalService) { this.cpRuleLocalService = cpRuleLocalService; }
[ "public", "void", "setCPRuleLocalService", "(", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "service", ".", "CPRuleLocalService", "cpRuleLocalService", ")", "{", "this", ".", "cpRuleLocalService", "=", "cpRuleLocalService", ";", "}" ]
Sets the cp rule local service. @param cpRuleLocalService the cp rule local service
[ "Sets", "the", "cp", "rule", "local", "service", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L905-L908
train