/** * Create an instance of {@link ConstExpressionEvaluatorType } * */ public ConstExpressionEvaluatorType createConstExpressionEvaluatorType() { return new ConstExpressionEvaluatorType(); }
@Override public String shortDebugDump() { return "const:"+constEvaluatorType.getValue(); }
public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); }
public ConstExpressionEvaluatorType value(String value) { setValue(value); return this; }
public int hashCode() { final HashCodeStrategy strategy = DomAwareHashCodeStrategy.INSTANCE; return this.hashCode(null, strategy); }
/** * Creates and returns a deep copy of a given {@code javax.xml.bind.JAXBElement<com.evolveum.midpoint.xml.ns._public.common.common_3.ConstExpressionEvaluatorType>} instance. * * @param e * The instance to copy or {@code null}. * @return * A deep copy of {@code e} or {@code null} if {@code e} is {@code null}. */ @SuppressWarnings("unchecked") private static JAXBElement<ConstExpressionEvaluatorType> copyOfConstExpressionEvaluatorTypeElement(final JAXBElement<ConstExpressionEvaluatorType> e) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 if (e!= null) { final JAXBElement<ConstExpressionEvaluatorType> copy = new JAXBElement<ConstExpressionEvaluatorType>(e.getName(), e.getDeclaredType(), e.getScope(), e.getValue()); copy.setNil(e.isNil()); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.ConstExpressionEvaluatorType copy.setValue(((((ConstExpressionEvaluatorType) copy.getValue()) == null)?null:((ConstExpressionEvaluatorType) copy.getValue()).clone())); return copy; } return null; }
/** * Creates a new {@code ConstExpressionEvaluatorType} instance by deeply copying a given {@code ConstExpressionEvaluatorType} instance. * * * @param o * The instance to copy. * @throws NullPointerException * if {@code o} is {@code null}. */ public ConstExpressionEvaluatorType(final ConstExpressionEvaluatorType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 super(); if (o == null) { throw new NullPointerException("Cannot create a copy of 'ConstExpressionEvaluatorType' from 'null'."); } // CBuiltinLeafInfo: java.lang.String this.value = ((o.value == null)?null:o.getValue()); }
/** * Create an instance of {@link ConstExpressionEvaluatorType } * */ public ConstExpressionEvaluatorType createConstExpressionEvaluatorType() { return new ConstExpressionEvaluatorType(); }
public static String prettyPrint(ConstExpressionEvaluatorType expressionType) { if (expressionType == null) { return "null"; } StringBuilder sb = new StringBuilder("ConstExpressionEvaluatorType("); sb.append(expressionType.getValue()); sb.append(")"); return sb.toString(); }
/** * Create an instance of {@link ConstExpressionEvaluatorType } * */ public ConstExpressionEvaluatorType createConstExpressionEvaluatorType() { return new ConstExpressionEvaluatorType(); }
/** * Creates and returns a deep copy of this object. * * * @return * A deep copy of this object. */ @Override public ConstExpressionEvaluatorType clone() { try { { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 final ConstExpressionEvaluatorType clone = ((ConstExpressionEvaluatorType) super.clone()); // CBuiltinLeafInfo: java.lang.String clone.value = ((this.value == null)?null:this.getValue()); return clone; } } catch (CloneNotSupportedException e) { // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError(e); } }
@Override public QName getElementName() { return new ObjectFactory().createConst(new ConstExpressionEvaluatorType()).getName(); }
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { String theValue; theValue = this.getValue(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); } return currentHashCode; }
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof ConstExpressionEvaluatorType)) { return false; } if (this == object) { return true; } final ConstExpressionEvaluatorType that = ((ConstExpressionEvaluatorType) object); { String lhsValue; lhsValue = this.getValue(); String rhsValue; rhsValue = that.getValue(); if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { return false; } } return true; }
@Override public PrismValueDeltaSetTriple<V> evaluate(ExpressionEvaluationContext context) throws SchemaException, ExpressionEvaluationException, ObjectNotFoundException { String constName = constEvaluatorType.getValue(); String stringValue = constantsManager.getConstantValue(constName); Item<V, D> output = outputDefinition.instantiate(); Object value = ExpressionUtil.convertToOutputValue(stringValue, outputDefinition, protector); if (output instanceof PrismProperty) { ((PrismProperty<Object>) output).addRealValue(value); } else { throw new UnsupportedOperationException( "Can only generate values of property, not " + output.getClass()); } return ItemDeltaUtil.toDeltaSetTriple(output, null, prismContext); }
@Override protected void assertPrismContainerValueLocal(PrismContainerValue<MappingType> value) throws SchemaException { MappingType mappingType = value.getValue(); ExpressionType expressionType = mappingType.getExpression(); List<JAXBElement<?>> expressionEvaluatorElements = expressionType.getExpressionEvaluator(); assertEquals("Wrong number of expression evaluator elemenets", 1, expressionEvaluatorElements.size()); JAXBElement<?> expressionEvaluatorElement = expressionEvaluatorElements.get(0); Object evaluatorElementObject = expressionEvaluatorElement.getValue(); if (!(evaluatorElementObject instanceof ConstExpressionEvaluatorType)) { AssertJUnit.fail("Const expression is of type " + evaluatorElementObject.getClass().getName()); } ConstExpressionEvaluatorType constExpressionEvaluatorType = (ConstExpressionEvaluatorType)evaluatorElementObject; System.out.println("ConstExpressionEvaluatorType: "+constExpressionEvaluatorType); assertEquals("Wrong value in const evaluator", "foo", constExpressionEvaluatorType.getValue()); }