public StandardDOMEventAttributeTagProcessor(final String dialectPrefix, final String attrName) { super(TemplateMode.HTML, dialectPrefix, null, false, attrName, true, PRECEDENCE, false); Validate.notNull(attrName, "Complete name of target attribute cannot be null"); this.targetAttrCompleteName = attrName; }
/** * * @param expression expression * @param convertToString convertToString * @since 2.1.0 */ public SelectionVariableExpression(final String expression, final boolean convertToString) { super(); Validate.notNull(expression, "Expression cannot be null"); this.expression = expression; this.convertToString = convertToString; }
protected AbstractExpressionContext(final IEngineConfiguration configuration, final Locale locale) { super(locale); Validate.notNull(configuration, "Configuration cannot be null"); this.configuration = configuration; }
public MinusExpression(final Expression operand) { super(); Validate.notNull(operand, "Operand cannot be null"); this.operand = operand; }
public DialectConfiguration(final IDialect dialect) { super(); // Prefix CAN be null Validate.notNull(dialect, "Dialect cannot be null"); this.prefixSpecified = false; this.prefix = null; this.dialect = dialect; }
public Set<ICommentProcessor> getCommentProcessors(final TemplateMode templateMode) { Validate.notNull(templateMode, "Template mode cannot be null"); final Set<ICommentProcessor> processors = this.commentProcessorsByTemplateMode.get(templateMode); if (processors == null) { return Collections.EMPTY_SET; } return processors; }
public Set<IPreProcessor> getPreProcessors(final TemplateMode templateMode) { Validate.notNull(templateMode, "Template mode cannot be null"); final Set<IPreProcessor> preProcessors = this.preProcessors.get(templateMode); if (preProcessors == null) { return Collections.EMPTY_SET; } return preProcessors; }
public AssignationSequence parseAssignationSequence( final IExpressionContext context, final String input, final boolean allowParametersWithoutValue) { Validate.notNull(context, "Context cannot be null"); Validate.notNull(input, "Input cannot be null"); return AssignationUtils.parseAssignationSequence(context, input, allowParametersWithoutValue); }
public Fragment( final TemplateModel templateModel, final Map<String, Object> parameters, final boolean syntheticParameters) { super(); Validate.notNull(templateModel, "Template model cannot be null"); this.templateModel = templateModel; this.parameters = parameters != null ? Collections.unmodifiableMap(parameters) : null; this.syntheticParameters = (this.parameters != null && this.parameters.size() > 0 && syntheticParameters); }
public static <X> boolean containsAllValues(final Map<?,? super X> target, final X[] values) { Validate.notNull(target, "Cannot execute map containsAllValues: target is null"); Validate.notNull(values, "Cannot execute map containsAllValues: values is null"); return containsAllValues(target, Arrays.asList(values)); }
public void replaceWith(final IModel model, final boolean processable) { reset(); Validate.notNull(model, "Model cannot be null"); this.replaceWithModel = true; this.replaceWithModelValue = model; this.replaceWithModelProcessable = processable; }
public ExpressionSequence(final List<? extends IStandardExpression> expressions) { super(); Validate.notNull(expressions, "Expression list cannot be null"); Validate.containsNoNulls(expressions, "Expression list cannot contain any nulls"); this.expressions = Collections.unmodifiableList(expressions); }
public void replaceWith(final IModel model, final boolean processable) { reset(); Validate.notNull(model, "Model cannot be null"); this.replaceWithModel = true; this.replaceWithModelValue = model; this.replaceWithModelProcessable = processable; }
public void setAttribute(final String attributeName, final String attributeValue) { // Can be combined with others, no need to resetGathering Validate.notNull(attributeName, "Attribute name cannot be null"); ensureSetAttributeSize(); this.setAttribute = true; final Object[] values = this.setAttributeValues[this.setAttributeValuesSize]; values[0] = null; values[1] = attributeName; values[2] = attributeValue; values[3] = null; this.setAttributeValuesSize++; }
public static MatchingAttributeName forAttributeName(final TemplateMode templateMode, final AttributeName matchingAttributeName) { Validate.notNull(templateMode, "Template mode cannot be null"); Validate.notNull(matchingAttributeName, "Matching attribute name cannot be null"); if (templateMode == TemplateMode.HTML && !(matchingAttributeName instanceof HTMLAttributeName)) { throw new IllegalArgumentException("Attribute names for HTML template mode must be of class " + HTMLAttributeName.class.getName()); } else if (templateMode == TemplateMode.XML && !(matchingAttributeName instanceof XMLAttributeName)) { throw new IllegalArgumentException("Attribute names for XML template mode must be of class " + XMLAttributeName.class.getName()); } else if (templateMode.isText() && !(matchingAttributeName instanceof TextAttributeName)) { throw new IllegalArgumentException("Attribute names for any text template modes must be of class " + TextAttributeName.class.getName()); } return new MatchingAttributeName(templateMode, matchingAttributeName, null, false); }
public Boolean[] arrayIsFalse(final Object[] target) { Validate.notNull(target, "Target cannot be null"); final Boolean[] result = new Boolean[target.length]; for (int i = 0; i < target.length; i++) { result[i] = isFalse(target[i]); } return result; }
public Boolean arrayAnd(final Object[] target) { Validate.notNull(target, "Target cannot be null"); for (final Object aTarget : target) { if (!isTrue(aTarget).booleanValue()) { return Boolean.FALSE; } } return Boolean.TRUE; }
public String createAbsentMessageRepresentation( final ITemplateContext context, final Class<?> origin, final String key, final Object[] messageParameters) { Validate.notNull(key, "Message key cannot be null"); if (context.getLocale() != null) { return "??"+key+"_" + context.getLocale().toString() + "??"; } return "??"+key+"_" + "??"; }
public final String getAttributeValue(final AttributeName attributeName) { Validate.notNull(attributeName, "Attribute name cannot be null"); if (this.attributes == null) { return null; } final Attribute attribute = this.attributes.getAttribute(attributeName); return attribute != null? attribute.getValue() : null; }
public void setAttributeDefinitions(final AttributeDefinitions attributeDefinitions) { Validate.notNull(attributeDefinitions, "Attribute Definitions cannot be null"); // We precompute the AttributeDefinition of the target attribute in order to being able to use much // faster methods for setting/replacing attributes on the ElementAttributes implementation this.targetAttributeDefinition = attributeDefinitions.forName(getTemplateMode(), this.targetAttrCompleteName); }