@Override public Map<String, GssFunction> get() { Map<String, GssFunction> gssFunctionMap = super.get(); return ImmutableMap.<String, GssFunction>builder().putAll(gssFunctionMap) // TODO add a namespace for gwt-specific function ? .put(EvalFunction.getName(), new EvalFunction()) .put(ValueFunction.getName(), new ValueFunction()) .put(ResourceUrlFunction.getName(), new ResourceUrlFunction(context)) .build(); } }
@Override public boolean equals(Object obj) { if (obj instanceof InputSummary) { InputSummary other = (InputSummary) obj; return bindingProperties.equals(other.bindingProperties) && moduleLastModified == other.moduleLastModified && resourcesLastModified == other.resourcesLastModified && filenameHash == other.filenameHash; } return false; }
MethodSpec createMethod ) { ImmutableMap.Builder<String, String> propertyNameToVariableBuilder = ImmutableMap.builder(); for ( String name : beanInfo.getCreatorParameters().keySet() ) { String variableName = String.format( INSTANCE_BUILDER_VARIABLE_FORMAT, propertyIndex++ ); propertyNameToVariableBuilder.put( name, variableName ); PropertyInfo propertyInfo = properties.get( name ); ImmutableMap<String, String> propertyNameToVariable = propertyNameToVariableBuilder.build(); newInstanceMethodBuilder.addStatement( "int nbParamToFind = $L", beanInfo.getCreatorParameters().size() ); for ( String name : beanInfo.getCreatorParameters().keySet() ) { String variableName = propertyNameToVariable.get( name ); PropertyInfo propertyInfo = properties.get( name ); for ( String name : beanInfo.getCreatorParameters().keySet() ) { String variableName = propertyNameToVariable.get( name ); PropertyInfo propertyInfo = properties.get( name ); for ( String name : beanInfo.getCreatorParameters().keySet() ) { String variableName = propertyNameToVariable.get( name ); PropertyInfo propertyInfo = properties.get( name ); parameterizedName( Instance.class, beanInfo.getType() ), createMethod, Joiner.on( ", " ).join( propertyNameToVariable.values() ) );
builder.setCreatorParameters( ImmutableMap.of( BeanJsonDeserializerCreator.DELEGATION_PARAM_NAME, creatorMethod.get() .getParameters()[0] ) ); } else { ImmutableMap.Builder<String, JParameter> creatorParameters = ImmutableMap.builder(); for ( int i = 0; i < creatorMethod.get().getParameters().length; i++ ) { creatorParameters.put( creators.get( 0 ).getParameters()[i].getAnnotation( JsonProperty.class ).value(), creators
private Map<String, Long> getMetricMapSnapshot() { TreeLogger logger = getLogger(); if (logger instanceof AbstractTreeLogger) { return ((AbstractTreeLogger)logger).getMetricMap().getSnapshot(); } return ImmutableMap.of(); // not found }
InputSummary(Map<String, String> bindingProperties, ModuleDef module) { this.bindingProperties = ImmutableMap.copyOf(bindingProperties); this.moduleLastModified = module.lastModified(); this.resourcesLastModified = module.getResourceLastModified(); this.filenameHash = module.getInputFilenameHash(); }
ClassName.get( HasDeserializerAndParameters.class ) ); if ( null != beanInfo.getCreatorParameters() && !beanInfo.getCreatorParameters().isEmpty() ) { for ( Entry<String, JParameter> entry : beanInfo.getCreatorParameters().entrySet() ) { List<MethodSpec> commonMethods = buildCommonPropertyDeserializerMethods( properties.get( entry.getKey() ) ); for ( MethodSpec method : commonMethods ) { deserializerBuilder.addMethod( method );
List<PropertyInfo> backReferenceProperties = new ArrayList<PropertyInfo>(); for ( PropertyInfo property : properties.values() ) { if ( null != beanInfo.getCreatorParameters() && beanInfo.getCreatorParameters().containsKey( property.getPropertyName() ) ) {
PropertyInfo propertyInfo = mapperInfo.getProperties().get( identityInfo.getPropertyName() ); JSerializerType propertySerializerType = getJsonSerializerFromType( propertyInfo.getType() );
/** * Build the code to initialize a {@link TypeSerializationInfo} or {@link TypeDeserializationInfo}. * * @param typeInfo the type information obtained through the {@link JsonTypeInfo} annotation * @return the code built */ protected final CodeBlock generateTypeInfo( BeanTypeInfo typeInfo ) { Class type; ImmutableMap<JClassType, String> mapTypeToMetadata; if ( isSerializer() ) { type = TypeSerializationInfo.class; mapTypeToMetadata = typeInfo.getMapTypeToSerializationMetadata(); } else { type = TypeDeserializationInfo.class; mapTypeToMetadata = typeInfo.getMapTypeToDeserializationMetadata(); } CodeBlock.Builder builder = CodeBlock.builder() .add( "new $T($T.$L, $S)", type, As.class, typeInfo.getInclude(), typeInfo.getPropertyName() ) .indent() .indent(); for ( Entry<JClassType, String> entry : mapTypeToMetadata.entrySet() ) { builder.add( "\n.addTypeInfo($T.class, $S)", rawName( entry.getKey() ), entry.getValue() ); } return builder.unindent().unindent().build(); }
private Map<String, Long> getMetricMapSnapshot() { TreeLogger logger = getLogger(); if (logger instanceof AbstractTreeLogger) { return ((AbstractTreeLogger)logger).getMetricMap().getSnapshot(); } return ImmutableMap.of(); // not found }
InputSummary(Map<String, String> bindingProperties, ModuleDef module) { this.bindingProperties = ImmutableMap.copyOf(bindingProperties); this.moduleLastModified = module.lastModified(); this.resourcesLastModified = module.getResourceLastModified(); this.filenameHash = module.getInputFilenameHash(); }
private CssParsingResult parseResources(List<URL> resources, ResourceContext context, TreeLogger logger) throws UnableToCompleteException { List<SourceCode> sourceCodes = new ArrayList<>(resources.size()); ImmutableMap.Builder<String, String> constantNameMappingBuilder = ImmutableMap.builder();
private static MinimalRebuildCacheManager createMinimalRebuildCacheManager( PrintWriterTreeLogger logger, Options options,File baseCacheDir) { return new MinimalRebuildCacheManager( logger, baseCacheDir, ImmutableMap.of( "style", options.getOutput().name(), "closureFormattedOutput", String.valueOf(options.isClosureFormattedOutput()), "generateJsInteropExports", String.valueOf(options.shouldGenerateJsInteropExports()), "exportFilters", options.getJsInteropExportFilter().toString(), "methodDisplayMode", options.getMethodNameDisplayMode().name())); }
@Override public boolean equals(Object obj) { if (obj instanceof InputSummary) { InputSummary other = (InputSummary) obj; return bindingProperties.equals(other.bindingProperties) && moduleLastModified == other.moduleLastModified && resourcesLastModified == other.resourcesLastModified && filenameHash == other.filenameHash; } return false; }
private static ImmutableMap<JClassType, String> extractMetadata( TreeLogger logger, RebindConfiguration configuration, JClassType type, Optional<JsonTypeInfo> jsonTypeInfo, Optional<JsonSubTypes> propertySubTypes, Optional<JsonSubTypes> typeSubTypes, ImmutableList<JClassType> allSubtypes ) throws UnableToCompleteException { ImmutableMap.Builder<JClassType, String> classToMetadata = ImmutableMap.builder(); classToMetadata.put( type, extractTypeMetadata( logger, configuration, type, type, jsonTypeInfo .get(), propertySubTypes, typeSubTypes, allSubtypes ) ); for ( JClassType subtype : allSubtypes ) { classToMetadata.put( subtype, extractTypeMetadata( logger, configuration, type, subtype, jsonTypeInfo .get(), propertySubTypes, typeSubTypes, allSubtypes ) ); } return classToMetadata.build(); }
private CssParsingResult parseResources(List<URL> resources, TreeLogger logger) throws UnableToCompleteException { List<SourceCode> sourceCodes = new ArrayList<SourceCode>(resources.size()); ImmutableMap.Builder<String, String> constantNameMappingBuilder = ImmutableMap.builder();