code
stringlengths
73
34.1k
label
stringclasses
1 value
public static boolean isEmptyCriteria(final Criteria criteria) { return isEmpty(criteria.getAliases()) && isEmpty(criteria.getDeviceTypes()) && isEmpty(criteria.getCategories()); }
java
@Override public DashboardData loadDashboardData() { long totalApps = totalApplicationNumber(); long totalDevices = totalDeviceNumber(); long totalMessages = totalMessages(); final DashboardData data = new DashboardData(); data.setApplications(totalApps); data.setD...
java
@Override public List<ApplicationVariant> getVariantsWithWarnings() { final List<String> warningIDs = flatPushMessageInformationDao.findVariantIDsWithWarnings(); if (warningIDs.isEmpty()) { return Collections.emptyList(); } return wrapApplicationVariant(pushApplicationDa...
java
@GET @Path("/application/{id}") @Produces(MediaType.APPLICATION_JSON) public Response pushMessageInformationPerApplication( @PathParam("id") String id, @QueryParam("page") Integer page, @QueryParam("per_page") Integer pageSize, @QueryParam("sort") String sorti...
java
public static String tryGetGlobalProperty(String key, String defaultValue) { try { String value = System.getenv(formatEnvironmentVariable(key)); if (value == null) { value = tryGetProperty(key, defaultValue); } return value; } catch (Securi...
java
public static Integer tryGetGlobalIntegerProperty(String key, Integer defaultValue) { try { String value = System.getenv(formatEnvironmentVariable(key)); if (value == null) { return tryGetIntegerProperty(key, defaultValue); } else { return Inte...
java
@GET @Produces(MediaType.APPLICATION_JSON) public Response listAllWindowsVariationsForPushApp(@PathParam("pushAppID") String pushApplicationID) { final PushApplication application = getSearch().findByPushApplicationIDForDeveloper(pushApplicationID); return Response.ok(getVariants(application)).b...
java
@PUT @Path("/{windowsID}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response updateWindowsVariant( @PathParam("windowsID") String windowsID, WindowsVariant updatedWindowsVariant) { WindowsVariant windowsVariant = (WindowsVariant)...
java
protected void sendNonTransacted(Destination destination, Serializable message) { send(destination, message, null, null, false); }
java
protected void sendTransacted(Destination destination, Serializable message) { send(destination, message, null, null, true); }
java
protected void sendNonTransacted(Destination destination, Serializable message, String propertyName, String propertValue) { send(destination, message, propertyName, propertValue, false); }
java
protected void sendTransacted(Destination destination, Serializable message, String propertyName, String propertValue) { send(destination, message, propertyName, propertValue, true); }
java
public void disconnectOnChange(@Observes final iOSVariantUpdateEvent iOSVariantUpdateEvent) { final iOSVariant variant = iOSVariantUpdateEvent.getiOSVariant(); final String connectionKey = extractConnectionKey(variant); final ApnsClient client = apnsClientExpiringMap.remove(connectionKey); ...
java
@Override public ResultsStream.QueryBuilder<String> findAllDeviceTokenForVariantIDByCriteria(String variantID, List<String> categories, List<String> aliases, List<String> deviceTypes, int maxResults, String lastTokenFromPreviousBatch) { return installationDao.findAllDeviceTokenForVariantIDByCriteria(variant...
java
@GET @Path("/{installationID}") @Produces(MediaType.APPLICATION_JSON) public Response findInstallation(@PathParam("variantID") String variantId, @PathParam("installationID") String installationId) { Installation installation = clientInstallationService.findById(installationId); if (install...
java
@PUT @Path("/{installationID}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response updateInstallation(Installation entity, @PathParam("variantID") String variantId, @PathParam("installationID") String installationId) { Installation installation = clientI...
java
@GET @Path("/{variantId}/installations/") @Produces(MediaType.APPLICATION_JSON) @GZIP public Response exportInstallations(@PathParam("variantId") String variantId) { return Response.ok(getSearch().findAllInstallationsByVariantForDeveloper(variantId, 0, Integer.MAX_VALUE, null).getResultList()).b...
java
private void processFCM(AndroidVariant androidVariant, List<String> pushTargets, Message fcmMessage, ConfigurableFCMSender sender) throws IOException { // push targets can be registration IDs OR topics (starting /topic/), but they can't be mixed. if (pushTargets.get(0).startsWith(Constants.TOPIC_PREFI...
java
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response registerPushApplication(PushApplication pushApp) { try { validateModelClass(pushApp); } catch (ConstraintViolationException cve) { logger.trace("Unable to create Push Ap...
java
@GET @Produces(MediaType.APPLICATION_JSON) public Response listAllPushApplications(@QueryParam("page") Integer page, @QueryParam("per_page") Integer pageSize, @QueryParam("includeDeviceCount") @DefaultValue("false") boolean ...
java
@GET @Path("/{pushAppID}") @Produces(MediaType.APPLICATION_JSON) public Response findById( @PathParam("pushAppID") String pushApplicationID, @QueryParam("includeDeviceCount") @DefaultValue("false") boolean includeDeviceCount, @QueryParam("includeActivity") @DefaultValu...
java
@PUT @Path("/{pushAppID}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response updatePushApplication(@PathParam("pushAppID") String pushApplicationID, PushApplication updatedPushApp) { PushApplication pushApp = getSearch().findByPushApplicationIDForDevelo...
java
@PUT @Path("/{pushAppID}/reset") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response resetMasterSecret(@PathParam("pushAppID") String pushApplicationID) { //PushApplication pushApp = pushAppService.findByPushApplicationIDForDeveloper(pushApplicationID, ex...
java
@DELETE @Path("/{pushAppID}") @Produces(MediaType.APPLICATION_JSON) public Response deletePushApplication(@PathParam("pushAppID") String pushApplicationID) { PushApplication pushApp = getSearch().findByPushApplicationIDForDeveloper(pushApplicationID); if (pushApp != null) { log...
java
@GET @Path("/{pushAppID}/count") @Produces(MediaType.APPLICATION_JSON) public Response countInstallations(@PathParam("pushAppID") String pushApplicationID) { logger.trace("counting devices by type for push application '{}'", pushApplicationID); Map<String, Long> result = pushAppService.coun...
java
private SenderConfiguration validateAndSanitizeConfiguration(VariantType type, SenderConfiguration configuration) { switch (type) { case ANDROID: if (configuration.batchSize() > 1000) { logger.warn(String .format("Sender configuration -...
java
public static Boolean isAscendingOrder(String sorting) { return "desc".equalsIgnoreCase(sorting) ? Boolean.FALSE : Boolean.TRUE; }
java
public String toStrippedJsonString() { try { final Map<String, Object> json = new LinkedHashMap<>(); json.put("alert", this.message.getAlert()); json.put("priority", this.message.getPriority().toString()); if (this.getMessage().getBadge()>0) { json...
java
public String toMinimizedJsonString() { try { final Map<String, Object> json = new LinkedHashMap<>(); json.put("alert", this.message.getAlert()); if (this.getMessage().getBadge()>0) { json.put("badge", Integer.toString(this.getMessage().getBadge())); ...
java
protected void validateModelClass(Object model) { final Set<ConstraintViolation<Object>> violations = validator.validate(model); // in case of an invalid model, we throw a ConstraintViolationException, containing the violations: if (!violations.isEmpty()) { throw new ConstraintViola...
java
protected ResponseBuilder createBadRequestResponse(Set<ConstraintViolation<?>> violations) { final Map<String, String> responseObj = violations.stream() .collect(Collectors.toMap(v -> v.getPropertyPath().toString(), ConstraintViolation::getMessage)); return Response.status(Response.Stat...
java
private static void checkBlockEndContext(RenderUnitNode node, Context endContext) { if (!endContext.isValidEndContextForContentKind( MoreObjects.firstNonNull(node.getContentKind(), SanitizedContentKind.HTML))) { String msg = String.format( "A block of kind=\"%s\" cannot end in ...
java
static void inferStrictRenderUnitNode( RenderUnitNode node, Inferences inferences, ErrorReporter errorReporter) { InferenceEngine inferenceEngine = new InferenceEngine(inferences, errorReporter); // Context started off as startContext and we have propagated context through all of // node's children, s...
java
private static String parseFormat(List<? extends TargetExpr> args) { String numberFormatType = !args.isEmpty() ? args.get(0).getText() : "'" + DEFAULT_FORMAT + "'"; if (!JS_ARGS_TO_ENUM.containsKey(numberFormatType)) { String validKeys = Joiner.on("', '").join(JS_ARGS_TO_ENUM.keySet()); throw new I...
java
private ProtoClass clazz() { ProtoClass localClazz = clazz; if (localClazz == null) { localClazz = classCache.getUnchecked(proto.getDescriptorForType()); clazz = localClazz; } return localClazz; }
java
public SoyValue getProtoField(String name) { FieldWithInterpreter field = clazz().fields.get(name); if (field == null) { throw new IllegalArgumentException( "Proto " + proto.getClass().getName() + " does not have a field of name " + name); } if (field.shouldCheckFieldPresenceToEmulateJsp...
java
public static <T extends Field> ImmutableMap<String, T> getFieldsForType( Descriptor descriptor, Set<FieldDescriptor> extensions, Factory<T> factory) { ImmutableMap.Builder<String, T> fields = ImmutableMap.builder(); for (FieldDescriptor fieldDescriptor : descriptor.getFields()) { if (ProtoUtils.sho...
java
private Optional<SoyType> soyTypeForProtoOrEnum(Class<?> type, Method method) { // Message isn't supported because we can't get a descriptor from it. if (type == Message.class) { reporter.invalidReturnType(Message.class, method); return Optional.absent(); } Optional<String> fullName = nameFr...
java
private boolean isOrContains(SoyType type, SoyType.Kind kind) { if (type.getKind() == kind) { return true; } if (type.getKind() == SoyType.Kind.UNION) { for (SoyType member : ((UnionType) type).getMembers()) { if (member.getKind() == kind) { return true; } } }...
java
public static String getFieldName( Descriptors.FieldDescriptor field, boolean capitializeFirstLetter) { String fieldName = field.getName(); if (SPECIAL_CASES.containsKey(fieldName)) { String output = SPECIAL_CASES.get(fieldName); if (capitializeFirstLetter) { return output; } els...
java
public static String underscoresToCamelCase(String input, boolean capitializeNextLetter) { StringBuilder result = new StringBuilder(); for (int i = 0; i < input.length(); i++) { char ch = input.charAt(i); if ('a' <= ch && ch <= 'z') { if (capitializeNextLetter) { result.append((cha...
java
private static boolean hasConflictingClassName(DescriptorProto messageDesc, String name) { if (name.equals(messageDesc.getName())) { return true; } for (EnumDescriptorProto enumDesc : messageDesc.getEnumTypeList()) { if (name.equals(enumDesc.getName())) { return true; } } f...
java
private static boolean hasConflictingClassName(FileDescriptorProto file, String name) { for (EnumDescriptorProto enumDesc : file.getEnumTypeList()) { if (name.equals(enumDesc.getName())) { return true; } } for (ServiceDescriptorProto serviceDesc : file.getServiceList()) { if (name....
java
public static IntegerData forValue(long value) { if (value > 10 || value < -1) { return new IntegerData(value); } switch ((int) value) { case -1: return MINUS_ONE; case 0: return ZERO; case 1: return ONE; case 2: return TWO; case 3: ...
java
PyExpr exec(CallNode callNode, LocalVariableStack localVarStack, ErrorReporter errorReporter) { this.localVarStack = localVarStack; this.errorReporter = errorReporter; PyExpr callExpr = visit(callNode); this.localVarStack = null; this.errorReporter = null; return callExpr; }
java
@Override protected PyExpr visitCallBasicNode(CallBasicNode node) { String calleeName = node.getCalleeName(); // Build the Python expr text for the callee. String calleeExprText; TemplateNode template = getTemplateIfInSameFile(node); if (template != null) { // If in the same module no names...
java
@Override protected PyExpr visitCallDelegateNode(CallDelegateNode node) { ExprRootNode variantSoyExpr = node.getDelCalleeVariantExpr(); PyExpr variantPyExpr; if (variantSoyExpr == null) { // Case 1: Delegate call with empty variant. variantPyExpr = new PyStringExpr("''"); } else { //...
java
public String genObjToPass(CallNode callNode) { TranslateToPyExprVisitor translator = new TranslateToPyExprVisitor(localVarStack, pluginValueFactory, errorReporter); // Generate the expression for the original data to pass. String dataToPass; if (callNode.isPassingAllData()) { dataToPass ...
java
private PyExpr escapeCall(String callExpr, ImmutableList<SoyPrintDirective> directives) { PyExpr escapedExpr = new PyExpr(callExpr, Integer.MAX_VALUE); if (directives.isEmpty()) { return escapedExpr; } // Successively wrap each escapedExpr in various directives. for (SoyPrintDirective directi...
java
static String getLocalTemplateName(TemplateNode node) { String templateName = node.getPartialTemplateName().substring(1); if (node.getVisibility() == Visibility.PRIVATE) { return "__" + templateName; } return templateName; }
java
void checkConformance() { resetErrorReporter(); // to check conformance we only need to run as much as it takes to execute the SoyConformance // pass. parse( passManagerBuilder() // We have to set disableAllTypeChecking to make sure default parameter types don't // break ...
java
public void extractAndWriteMsgs( SoyMsgBundleHandler msgBundleHandler, OutputFileOptions options, ByteSink output) throws IOException { resetErrorReporter(); SoyMsgBundle bundle = doExtractMsgs(); msgBundleHandler.writeExtractedMsgs(bundle, options, output, errorReporter); throwIfErrorsPrese...
java
private SoyMsgBundle doExtractMsgs() { // extractMsgs disables a bunch of passes since it is typically not configured with things // like global definitions, type definitions, plugins, etc. SoyFileSetNode soyTree = parse( passManagerBuilder() .allowUnknownGlobals(...
java
private ServerCompilationPrimitives compileForServerRendering() { ParseResult result = parse(); throwIfErrorsPresent(); SoyFileSetNode soyTree = result.fileSet(); TemplateRegistry registry = result.registry(); // Clear the SoyDoc strings because they use unnecessary memory, unless we have a cache, ...
java
public List<String> compileToIncrementalDomSrc(SoyIncrementalDomSrcOptions jsSrcOptions) { resetErrorReporter(); // For incremental dom backend, we don't desugar HTML nodes since it requires HTML context. ParseResult result = parse(passManagerBuilder().desugarHtmlNodes(false)); throwIfErrorsPresent(); ...
java
void compileToPySrcFiles(String outputPathFormat, SoyPySrcOptions pySrcOptions) throws IOException { resetErrorReporter(); ParseResult result = parse(); throwIfErrorsPresent(); new PySrcMain(scopedData.enterable()) .genPyFiles(result.fileSet(), pySrcOptions, outputPathFormat, errorReporter...
java
ParseResult compileMinimallyForHeaders() { resetErrorReporter(); ParseResult result = parse( passManagerBuilder() // ResolveExpressionTypesPass resolve types (specifically on default parameter // values) which is necessary for template metadatas ...
java
private void reportWarnings() { ImmutableList<SoyError> warnings = errorReporter.getWarnings(); if (warnings.isEmpty()) { return; } // this is a custom feature used by the integration test suite. if (generalOptions.getExperimentalFeatures().contains("testonly_throw_on_warnings")) { error...
java
@SuppressWarnings("unchecked") // If a.equals(b) then a and b have the same type. public synchronized <T> T intern(T value) { Preconditions.checkNotNull(value); // Use a pseudo-random number generator to mix up the high and low bits of the hash code. Random generator = new java.util.Random(value.hashCode...
java
@GuardedBy("this") private void rehashIfNeeded() { int currentSize = table.length; if (currentSize - count >= currentSize / (MAX_EXPECTED_COLLISION_COUNT + 1)) { // Still enough overhead. return; } Object[] oldTable = table; // Grow the table so it increases by 1 / GROWTH_DENOMINATOR....
java
private Statement handleBasicTranslation( List<SoyPrintDirective> escapingDirectives, Expression soyMsgParts) { // optimize for simple constant translations (very common) // this becomes: renderContext.getSoyMessge(<id>).getParts().get(0).getRawText() SoyExpression text = SoyExpression.forStri...
java
private Statement handleTranslationWithPlaceholders( MsgNode msg, ImmutableList<SoyPrintDirective> escapingDirectives, Expression soyMsgParts, Expression locale, MsgPartsAndIds partsAndId) { // We need to render placeholders into a buffer and then pack them into a map to pass to //...
java
private Function<Expression, Statement> addNodeToPlaceholderMap( String mapKey, StandaloneNode node) { return putToMapFunction( mapKey, placeholderCompiler.compileToSoyValueProvider( mapKey, node, /* prefix= */ ExtraCodeCompiler.NO_OP, /* suffix=...
java
public static JsExpr concatJsExprs(List<? extends JsExpr> jsExprs) { if (jsExprs.isEmpty()) { return EMPTY_STRING; } if (jsExprs.size() == 1) { return jsExprs.get(0); } int plusOpPrec = Operator.PLUS.getPrecedence(); StringBuilder resultSb = new StringBuilder(); boolean isFirs...
java
@VisibleForTesting static JsExpr wrapWithFunction(String functionExprText, JsExpr jsExpr) { Preconditions.checkNotNull(functionExprText); return new JsExpr(functionExprText + "(" + jsExpr.getText() + ")", Integer.MAX_VALUE); }
java
@SuppressWarnings("unchecked") private int mergeRange(ParentSoyNode<?> parent, int start, int lastNonEmptyRawTextNode, int end) { checkArgument(start < end); if (start == -1 || end == start + 1) { return end; } // general case, there are N rawtextnodes to merge where n > 1 // merge all the n...
java
public void writeEntry(String path, ByteSource contents) throws IOException { stream.putNextEntry(new ZipEntry(path)); contents.copyTo(stream); stream.closeEntry(); }
java
private static Manifest standardSoyJarManifest() { Manifest mf = new Manifest(); mf.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0"); mf.getMainAttributes().put(new Attributes.Name("Created-By"), "soy"); return mf; }
java
private void addTypeSubstitutions(Map<Wrapper<ExprNode>, SoyType> substitutionsToAdd) { for (Map.Entry<Wrapper<ExprNode>, SoyType> entry : substitutionsToAdd.entrySet()) { ExprNode expr = entry.getKey().get(); // Get the existing type SoyType previousType = expr.getType(); for (TypeSubstitut...
java
private SoyType getElementType(SoyType collectionType, ForNonemptyNode node) { Preconditions.checkNotNull(collectionType); switch (collectionType.getKind()) { case UNKNOWN: // If we don't know anything about the base type, then make no assumptions // about the field type. return Un...
java
public SoySauceBuilder withPluginInstances(Map<String, Supplier<Object>> pluginInstances) { this.userPluginInstances = ImmutableMap.copyOf(pluginInstances); return this; }
java
SoySauceBuilder withFunctions(Map<String, ? extends SoyFunction> userFunctions) { this.userFunctions = ImmutableMap.copyOf(userFunctions); return this; }
java
SoySauceBuilder withDirectives(Map<String, ? extends SoyPrintDirective> userDirectives) { this.userDirectives = ImmutableMap.copyOf(userDirectives); return this; }
java
public SoySauce build() { if (scopedData == null) { scopedData = new SoySimpleScope(); } if (loader == null) { loader = SoySauceBuilder.class.getClassLoader(); } return new SoySauceImpl( new CompiledTemplates(readDelTemplatesFromMetaInf(loader), loader), scopedData.entera...
java
private static ImmutableSet<String> readDelTemplatesFromMetaInf(ClassLoader loader) { try { ImmutableSet.Builder<String> builder = ImmutableSet.builder(); Enumeration<URL> resources = loader.getResources(Names.META_INF_DELTEMPLATE_PATH); while (resources.hasMoreElements()) { URL url = reso...
java
public boolean exec(TemplateNode template) { boolean hasOptional = false; for (TemplateParam param : template.getParams()) { if (param.isRequired()) { // If there exists a required param, then data should already be defined (no need to // ensure). return false; } else { ...
java
static void checkId(String id) { if (!ID.matcher(id).matches()) { throw new IllegalArgumentException(String.format("not a valid js identifier: %s", id)); } }
java
Iterable<ClassData> compile() { List<ClassData> classes = new ArrayList<>(); // first generate the factory if (templateNode.getVisibility() != Visibility.PRIVATE) { // Don't generate factory if the template is private. The factories are only // useful to instantiate templates for calls from ja...
java
private void generateConstructor( ImmutableMap<TemplateParam, SoyExpression> defaultParamInitializers) { final Label start = new Label(); final Label end = new Label(); final LocalVariable thisVar = createThisVar(template.typeInfo(), start, end); final LocalVariable paramsVar = createLocal("params...
java
static void checkTypes(ImmutableList<Type> types, Iterable<? extends Expression> exprs) { int size = Iterables.size(exprs); checkArgument( size == types.size(), "Supplied the wrong number of parameters. Expected %s, got %s", types.size(), size); // checkIsAssignableTo is an n...
java
public Statement toStatement() { return new Statement() { @Override protected void doGen(CodeBuilder adapter) { Expression.this.gen(adapter); switch (resultType().getSize()) { case 0: throw new AssertionError("void expressions are not allowed"); case 1: ...
java
public Expression checkedCast(final Type target) { checkArgument( target.getSort() == Type.OBJECT, "cast targets must be reference types. (%s)", target.getClassName()); checkArgument( resultType().getSort() == Type.OBJECT, "you may only cast from reference types. (%s)", ...
java
public Expression labelStart(final Label label) { return new Expression(resultType(), features) { @Override protected void doGen(CodeBuilder adapter) { adapter.mark(label); Expression.this.gen(adapter); } }; }
java
public void setParamsToRuntimeCheck(Predicate<String> paramNames) { checkState(this.paramsToRuntimeTypeCheck == null); this.paramsToRuntimeTypeCheck = checkNotNull(paramNames); }
java
public static SanitizedContent cleanHtml( SoyValue value, Collection<? extends OptionalSafeTag> optionalSafeTags) { value = normalizeNull(value); Dir valueDir = null; if (value instanceof SanitizedContent) { SanitizedContent sanitizedContent = (SanitizedContent) value; if (sanitizedContent...
java
public static SanitizedContent cleanHtml( String value, Collection<? extends OptionalSafeTag> optionalSafeTags) { return cleanHtml(value, null, optionalSafeTags); }
java
public static SanitizedContent cleanHtml( String value, Dir contentDir, Collection<? extends OptionalSafeTag> optionalSafeTags) { return UnsafeSanitizedContentOrdainer.ordainAsSafe( stripHtmlTags(value, TagWhitelist.FORMATTING.withOptionalSafeTags(optionalSafeTags), true), ContentKind.HTML, ...
java
public static String normalizeHtml(SoyValue value) { value = normalizeNull(value); return normalizeHtml(value.coerceToString()); }
java
public static String normalizeHtmlNospace(SoyValue value) { value = normalizeNull(value); return normalizeHtmlNospace(value.coerceToString()); }
java
public static String escapeHtmlAttribute(SoyValue value) { value = normalizeNull(value); if (isSanitizedContentOfKind(value, SanitizedContent.ContentKind.HTML)) { // |escapeHtmlAttribute should only be used on attribute values that cannot have tags. return stripHtmlTags(value.coerceToString(), null,...
java
public static String escapeHtmlAttributeNospace(SoyValue value) { value = normalizeNull(value); if (isSanitizedContentOfKind(value, SanitizedContent.ContentKind.HTML)) { // |escapeHtmlAttributeNospace should only be used on attribute values that cannot have tags. return stripHtmlTags(value.coerceToS...
java
public static String escapeUri(SoyValue value) { value = normalizeNull(value); return escapeUri(value.coerceToString()); }
java
public static String filterNormalizeMediaUri(String value) { if (EscapingConventions.FilterNormalizeMediaUri.INSTANCE .getValueFilter() .matcher(value) .find()) { return EscapingConventions.FilterNormalizeMediaUri.INSTANCE.escape(value); } logger.log(Level.WARNING, "|filterNorm...
java
public static String filterTrustedResourceUri(SoyValue value) { value = normalizeNull(value); if (isSanitizedContentOfKind(value, SanitizedContent.ContentKind.TRUSTED_RESOURCE_URI)) { return value.coerceToString(); } logger.log(Level.WARNING, "|filterTrustedResourceUri received bad value ''{0}''",...
java
public static SanitizedContent filterImageDataUri(SoyValue value) { value = normalizeNull(value); return filterImageDataUri(value.coerceToString()); }
java
public static SanitizedContent filterSipUri(SoyValue value) { value = normalizeNull(value); return filterSipUri(value.coerceToString()); }
java
public static SanitizedContent filterTelUri(SoyValue value) { value = normalizeNull(value); return filterTelUri(value.coerceToString()); }
java
public static String filterHtmlAttributes(SoyValue value) { value = normalizeNull(value); if (isSanitizedContentOfKind(value, SanitizedContent.ContentKind.ATTRIBUTES)) { // We're guaranteed to be in a case where key=value pairs are expected. However, if it would // cause issues to directly abut this...
java
public static String filterHtmlAttributes(String value) { if (EscapingConventions.FilterHtmlAttributes.INSTANCE.getValueFilter().matcher(value).find()) { return value; } logger.log(Level.WARNING, "|filterHtmlAttributes received bad value ''{0}''", value); return EscapingConventions.FilterHtmlAttri...
java
private static boolean isSanitizedContentOfKind( SoyValue value, SanitizedContent.ContentKind kind) { return value instanceof SanitizedContent && kind == ((SanitizedContent) value).getContentKind(); }
java