private static String getExpression(final PropertyDescriptor descriptor) { final PropertyExpression expression = descriptor.getDefaultExpression(); return expression != null ? expression.getExpression() : null; }
/** * Creates an instance of {@link PropertyExpression} with the given expression * string. * * @param expression the expression string. * @return the created instance. If the {@code expression} is blank, the * singleton expression {@link #NO_EXPRESSION} is returned. */ public static PropertyExpression create(final String expression) { if (StringUtils.isBlank(expression)) { return NO_EXPRESSION; } return new PropertyExpression(expression); }
private static void addExpression(final Builder builder, final Method method) { final de.smartics.properties.api.core.annotations.PropertyExpression annotation = method .getAnnotation(de.smartics.properties.api.core.annotations.PropertyExpression.class); if (annotation != null) { final String expressionString = annotation.value(); final PropertyExpression expression = PropertyExpression.create(expressionString); builder.with(expression); } }
private static String getExpression(final PropertyDescriptor descriptor) { final PropertyExpression expression = descriptor.getDefaultExpression(); return expression != null ? expression.getExpression() : null; }
@Override public void handle(final PropertyReportItem item) throws ReportException { super.handle(item); final PropertyDescriptor descriptor = item.getDescriptor(); final String key = descriptor.getKey().toString(); final PropertyExpression expression = descriptor.getDefaultExpression(); final String value = expression != null && expression.getExpression() != null ? expression .getExpression() : ""; currentProperties.setProperty(key, value); }
/** * {@inheritDoc} * * @see de.smartics.properties.spi.config.resolve.ResolveContext#get(java.lang.String) */ @Override public String get(final String key) throws IllegalArgumentException, UnknownPropertyException, PropertyValidationException { final Property property = config.getProperty(key); if (property == null) { throw new UnknownPropertyException(getKey(), key); } String value = property.getValue(); if (value == null) { final PropertyDescriptor descriptor = registry.get(key); final PropertyExpression expression = descriptor.getDefaultExpression(); value = (expression != null ? expression.getExpression() : null); } return value; } // --- object basics --------------------------------------------------------
currentValue = expression.getExpression();
descriptor.getDefaultExpression().getExpression(); if (expression != null)