public Set<String> getBooleanConditions() { return ImmutableSet.copyOf(booleanConditions); }
private Set<String> getTrueConfigurationProperties(ResourceContext context, Set<String> configurationProperties, TreeLogger logger) throws UnableToCompleteException { Builder<String> setBuilder = ImmutableSet.builder(); PropertyOracle oracle = context.getGeneratorContext().getPropertyOracle(); for (String property : configurationProperties) { try { // TODO : only check configuration properties ? ConfigurationProperty confProp = oracle.getConfigurationProperty(property); if (!checkPropertyIsSingleValueAndBoolean(confProp, logger)) { throw new UnableToCompleteException(); } if ("true".equals(confProp.getValues().get(0))) { setBuilder.add(property); } } catch (BadPropertyValueException e1) { logger.log(Type.ERROR, "Unknown configuration property [" + property + "]"); throw new UnableToCompleteException(); } } return setBuilder.build(); }
/** * Selects first only the classes that are assignable from the target, and * then returns the most specific matching classes. * * @param target the Class to match * @param availableClasses classes to search * @return Set of only the most specific classes that match the target. */ static Set<Class<?>> findBestMatches(Class<?> target, Set<Class<?>> availableClasses) { Set<Class<?>> matches = new HashSet<Class<?>>(); if (availableClasses.contains(target)) { return ImmutableSet.<Class<?>> of(target); } else { for (Class<?> clazz : availableClasses) { if (clazz.isAssignableFrom(target)) { matches.add(clazz); } } } Predicate<Class<?>> moreSpecificClassPredicate = createMostSpecificMatchPredicate( matches, Functions.<Class<?>> identity()); return Sets.filter(matches, moreSpecificClassPredicate); }
/** * <p>isTypeSupportedForSerialization</p> * * @param logger a {@link com.google.gwt.core.ext.TreeLogger} object. * @param classType a {@link com.google.gwt.core.ext.typeinfo.JClassType} object. * @return a boolean. */ public boolean isTypeSupportedForSerialization( TreeLogger logger, JClassType classType ) { return allSupportedSerializationClass.contains( classType ) || additionalSupportedTypes.isIncluded( logger, classType.getQualifiedSourceName() ); }
private Set<String> getCurrentDeferredBindingProperties(ResourceContext context, List<String> permutationAxes, TreeLogger logger) throws UnableToCompleteException { Builder<String> setBuilder = ImmutableSet.builder(); PropertyOracle oracle = context.getGeneratorContext().getPropertyOracle(); for (String permutationAxis : permutationAxes) { String propValue; try { SelectionProperty selProp = oracle.getSelectionProperty(null, permutationAxis); propValue = selProp.getCurrentValue(); } catch (BadPropertyValueException e) { try { ConfigurationProperty confProp = oracle.getConfigurationProperty(permutationAxis); propValue = confProp.getValues().get(0); } catch (BadPropertyValueException e1) { logger.log(Type.ERROR, "Unknown configuration property [" + permutationAxis + "]"); throw new UnableToCompleteException(); } } if (propValue != null) { setBuilder.add(permutationAxis + ":" + propValue); } } return setBuilder.build(); }
/** * Selects first only the classes that are assignable from the target, and * then returns the most specific matching classes. * * @param target the Class to match * @param availableClasses classes to search * @return Set of only the most specific classes that match the target. */ static Set<Class<?>> findBestMatches(Class<?> target, Set<Class<?>> availableClasses) { Set<Class<?>> matches = new HashSet<Class<?>>(); if (availableClasses.contains(target)) { return ImmutableSet.<Class<?>> of(target); } else { for (Class<?> clazz : availableClasses) { if (clazz.isAssignableFrom(target)) { matches.add(clazz); } } } Predicate<Class<?>> moreSpecificClassPredicate = createMostSpecificMatchPredicate( matches, Functions.<Class<?>> identity()); return Sets.filter(matches, moreSpecificClassPredicate); }
/** * <p>isTypeSupportedForDeserialization</p> * * @param logger a {@link com.google.gwt.core.ext.TreeLogger} object. * @param classType a {@link com.google.gwt.core.ext.typeinfo.JClassType} object. * @return a boolean. */ public boolean isTypeSupportedForDeserialization( TreeLogger logger, JClassType classType ) { return allSupportedDeserializationClass.contains( classType ) || additionalSupportedTypes.isIncluded( logger, classType.getQualifiedSourceName() ); }
options.scopeFiles = ImmutableSet.copyOf(set);
private Set<String> getTrueConfigurationProperties(ResourceContext context, Set<String> configurationProperties, TreeLogger logger) throws UnableToCompleteException { Builder<String> setBuilder = ImmutableSet.builder(); PropertyOracle oracle = context.getGeneratorContext().getPropertyOracle(); for (String property : configurationProperties) { try { // TODO : only check configuration properties ? ConfigurationProperty confProp = oracle.getConfigurationProperty(property); if (!checkPropertyIsSingleValueAndBoolean(confProp, logger)) { throw new UnableToCompleteException(); } if ("true".equals(confProp.getValues().get(0))) { setBuilder.add(property); } } catch (BadPropertyValueException e1) { logger.log(Type.ERROR, "Unknown configuration property [" + property + "]"); throw new UnableToCompleteException(); } } return setBuilder.build(); }
if (best.isEmpty()) { throw new UnexpectedTypeException( "No " + constraint.getAnnotation() + " ConstraintValidator for type " + targetType); if (best.size() > 1) { throw new UnexpectedTypeException("More than one maximally specific " + constraint.getAnnotation() + " ConstraintValidator for type " + targetType + ", found "
/** * Selects first only the classes that are assignable from the target, and then returns the most * specific matching classes. * * @param target the Class to match * @param availableClasses classes to search * @return Set of only the most specific classes that match the target. */ static Set<Class<?>> findBestMatches(final Class<?> target, final Set<Class<?>> availableClasses) { final Set<Class<?>> matches = new HashSet<>(); if (availableClasses.contains(target)) { return ImmutableSet.<Class<?>>of(target); } else { for (final Class<?> clazz : availableClasses) { if (clazz.isAssignableFrom(target)) { matches.add(clazz); } } } final Predicate<Class<?>> moreSpecificClassPredicate = createMostSpecificMatchPredicate(matches, Functions.<Class<?>>identity()); return Sets.filter(matches, moreSpecificClassPredicate); }
private static boolean isPropertyIgnored( RebindConfiguration configuration, PropertyAccessors propertyAccessors, BeanInfo beanInfo, JType type, String propertyName ) { // we first check if the property is ignored Optional<JsonIgnore> jsonIgnore = propertyAccessors.getAnnotation( JsonIgnore.class ); if ( jsonIgnore.isPresent() && jsonIgnore.get().value() ) { return true; } // if type is ignored, we ignore the property if ( null != type.isClassOrInterface() ) { Optional<JsonIgnoreType> jsonIgnoreType = findFirstEncounteredAnnotationsOnAllHierarchy( configuration, type .isClassOrInterface(), JsonIgnoreType.class ); if ( jsonIgnoreType.isPresent() && jsonIgnoreType.get().value() ) { return true; } } // we check if it's not in the ignored properties return beanInfo.getIgnoredFields().contains( propertyName ); }
/** * Returns the tags passed to {@link #addTags}. */ synchronized Set<String> getTags() { return ImmutableSet.copyOf(tags); }
/** * Returns the tags passed to {@link #addTags}. */ synchronized Set<String> getTags() { return ImmutableSet.copyOf(tags); }