public List<String> getPermutationAxes() { return ImmutableList.copyOf(permutationAxesSet); }
@Override public List<CssValueNode> getCallResultNodes(List<CssValueNode> args, ErrorManager errorManager) throws GssFunctionException { CssValueNode functionToEval = args.get(0); SourceCodeLocation sourceCodeLocation = extractSourceCodeLocation(functionToEval); CssJavaExpressionNode result = new CssJavaExpressionNode(functionToEval.getValue(), sourceCodeLocation); return ImmutableList.of((CssValueNode) result); }
private ImmutableList<? extends JType> getTypeParameters( JClassType classType, boolean subtype ) { JParameterizedType parameterizedType = classType.isParameterized(); if ( null != parameterizedType ) { return ImmutableList.copyOf( parameterizedType.getTypeArgs() ); ImmutableList.Builder<JType> builder = ImmutableList.builder(); for ( JTypeParameter typeParameter : genericType.getTypeParameters() ) { JType arg = null; ImmutableList.Builder<JType> builder = ImmutableList.builder(); for ( JTypeParameter typeParameter : genericType.getTypeParameters() ) { builder.add( typeParameter.getBaseType() ); return ImmutableList.of();
RepeatStyle repeatStyle = options != null ? options.repeatStyle() : RepeatStyle.None; Builder<CssDeclarationNode> listBuilder = ImmutableList.builder(); SourceCodeLocation sourceCodeLocation = declaration.getSourceCodeLocation();
ImmutableList.Builder<JDeserializerType> parametersDeserializerBuilder = ImmutableList.builder(); for ( int i = 0; i < typeArgs.length; i++ ) { JDeserializerType parameterDeserializerType; return builder.instance( methodCallCodeWithClassParameters( configuredDeserializer.get(), ImmutableList.of( type ) ) ).build(); builder.parameters( ImmutableList.of( parameterDeserializerType ) ); builder.instance( CodeBlock.builder().add( "$T.newInstance($L, $L)", arrayDeserializer, parameterDeserializerType .getInstance(), arrayCreator ).build() ); ImmutableList.Builder<JParameterizedDeserializer> parametersDeserializerBuilder = ImmutableList.builder(); ImmutableList.Builder<JDeserializerType> parametersJsonDeserializerBuilder = ImmutableList.builder(); for ( JType argType : typeParameters ) { JDeserializerType jsonDeserializer = getJsonDeserializerFromType( argType, subtype );
private void writeThrowIllegalArgumnet(SourceWriter sourceWriter, String getClassName) { // throw new IllegalArgumentException("MyValidator can not validate ", sourceWriter.print("throw new IllegalArgumentException(\""); sourceWriter.print(this.validatorType.getName() + " can not validate \""); sourceWriter.indent(); sourceWriter.indent(); // + object.getClass().getName() +". " sourceWriter.print("+ "); sourceWriter.print(getClassName); sourceWriter.println("+ \". \""); // + "Valid values are {Foo.clas, Bar.class} sourceWriter.print("+ \"Valid types are "); sourceWriter.print(beansToValidate.toString()); sourceWriter.println("\");"); sourceWriter.outdent(); sourceWriter.outdent(); }
private static String findNameOnJsonSubTypes( JClassType baseType, JClassType subtype, ImmutableList<JClassType> allSubtypes, Optional<JsonSubTypes> propertySubTypes, Optional<JsonSubTypes> baseSubTypes ) { JsonSubTypes.Type typeFound = findTypeOnSubTypes( subtype, propertySubTypes ); if ( null != typeFound ) { return typeFound.name(); } typeFound = findTypeOnSubTypes( subtype, baseSubTypes ); if ( null != typeFound ) { return typeFound.name(); } if ( baseType != subtype ) { // we look in all the hierarchy JClassType type = subtype; while ( null != type ) { if ( allSubtypes.contains( type ) ) { JsonSubTypes.Type found = findTypeOnSubTypes( subtype, Optional.fromNullable( type .getAnnotation( JsonSubTypes.class ) ) ); if ( null != found ) { typeFound = found; } } type = type.getSuperclass(); } if ( null != typeFound ) { return typeFound.name(); } } return null; }
/** * Returns an event indicating the current status of each active job, in the order they were * submitted. * TODO: hook this up. */ synchronized ImmutableList<JobEvent> getActiveEvents() { ImmutableList.Builder<JobEvent> builder = ImmutableList.builder(); for (String id : activeJobIds) { JobEvent p = eventsByJobId.get(id); assert p != null; builder.add(p); } return builder.build(); } }
ImmutableList.Builder<JSerializerType> parametersSerializerBuilder = ImmutableList.builder(); for ( int i = 0; i < typeArgs.length; i++ ) { JSerializerType parameterSerializerType; builder.parameters( ImmutableList.of( parameterSerializerType ) ); builder.instance( CodeBlock.builder() .add( "$T.newInstance($L)", arraySerializer, parameterSerializerType.getInstance() ) ImmutableList.Builder<JParameterizedSerializer> parametersSerializerBuilder = ImmutableList.builder(); ImmutableList.Builder<JSerializerType> parametersJsonSerializerBuilder = ImmutableList.builder(); for ( JType argType : typeParameters ) { JSerializerType jsonSerializer = getJsonSerializerFromType( argType, subtype );
private void writeThrowIllegalArgumnet(SourceWriter sourceWriter, String getClassName) { // throw new IllegalArgumentException("MyValidator can not validate ", sourceWriter.print("throw new IllegalArgumentException(\""); sourceWriter.print(this.validatorType.getName() + " can not validate \""); sourceWriter.indent(); sourceWriter.indent(); // + object.getClass().getName() +". " sourceWriter.print("+ "); sourceWriter.print(getClassName); sourceWriter.println("+ \". \""); // + "Valid values are {Foo.clas, Bar.class} sourceWriter.print("+ \"Valid types are "); sourceWriter.print(beansToValidate.toString()); sourceWriter.println("\");"); sourceWriter.outdent(); sourceWriter.outdent(); }
public List<String> getPermutationAxes() { return ImmutableList.copyOf(permutationAxesSet); }
@Override public List<CssValueNode> getCallResultNodes(List<CssValueNode> args, ErrorManager errorManager) throws GssFunctionException { if (args.size() == 0 || args.size() > 3) { throw new GssFunctionException(getName() + " function takes one, two or three arguments"); } String functionPath = args.get(0).getValue(); String prefix = null; String suffix = null; if (args.size() > 1) { suffix = args.get(1).getValue(); } if (args.size() > 2) { prefix = args.get(2).getValue(); } CssDotPathNode cssDotPathNode = new CssDotPathNode(functionPath, prefix, suffix, args.get(0).getSourceCodeLocation()); return ImmutableList.of((CssValueNode) cssDotPathNode); }
/** * Returns an event indicating the current status of each active job, in the order they were * submitted. * TODO: hook this up. */ synchronized ImmutableList<JobEvent> getActiveEvents() { ImmutableList.Builder<JobEvent> builder = ImmutableList.builder(); for (String id : activeJobIds) { JobEvent p = eventsByJobId.get(id); assert p != null; builder.add(p); } return builder.build(); } }
ImmutableList.Builder<JDeserializerType> parametersDeserializerBuilder = ImmutableList.builder(); for ( int i = 0; i < typeArgs.length; i++ ) { JDeserializerType parameterDeserializerType; return builder.instance( methodCallCodeWithClassParameters( keyDeserializer.get(), ImmutableList.of( type ) ) ).build();
private void writeThrowIllegalArgumnet(final SourceWriter sourceWriter, final String getClassName) { // throw new IllegalArgumentException("MyValidator can not validate ", sourceWriter.print("throw new IllegalArgumentException(\""); sourceWriter.print(validatorType.getName() + " can not validate \""); sourceWriter.indent(); sourceWriter.indent(); // + object.getClass().getName() +". " sourceWriter.print("+ "); sourceWriter.print(getClassName); sourceWriter.println("+ \". \""); // + "Valid values are {Foo.clas, Bar.class} sourceWriter.print("+ \"Valid types are "); sourceWriter.print(beansToValidate.toString()); sourceWriter.println("\");"); sourceWriter.outdent(); sourceWriter.outdent(); }
public List<String> getPermutationAxes() { return ImmutableList.copyOf(permutationAxesSet); }
@Override public List<CssValueNode> getCallResultNodes(List<CssValueNode> cssValueNodes, ErrorManager errorManager) throws GssFunctionException { CssValueNode functionToEval = cssValueNodes.get(0); String value = functionToEval.getValue(); SourceCodeLocation location = functionToEval.getSourceCodeLocation(); String javaExpression = buildJavaExpression(value, location, errorManager); CssFunctionNode urlNode = buildUrlNode(javaExpression, location); return ImmutableList.<CssValueNode>of(urlNode); }
/** * If all the given tags are valid, returns a list containing the tags. * @throws java.lang.IllegalArgumentException if any tag is invalid. */ static ImmutableList<String> checkTags(Iterable<String> tags) { ImmutableList.Builder<String> builder = ImmutableList.builder(); for (String tag : tags) { if (!isValidTag(tag)) { throw new IllegalArgumentException("invalid tag: " + tag); } builder.add(tag); } return builder.build(); }
private CssDeclarationNode buildOverflowDeclaration(SourceCodeLocation location) { CssPropertyNode propertyNode = new CssPropertyNode("overflow", location); CssValueNode valueNode = new CssLiteralNode("hidden", location); CssPropertyValueNode propertyValueNode = new CssPropertyValueNode(ImmutableList.of(valueNode)); return createDeclarationNode(propertyNode, propertyValueNode, location, true); }