Package com.puppetlabs.geppetto.pp

Examples of com.puppetlabs.geppetto.pp.AttributeOperation


    SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
    AttributeOperationsElements access = grammarAccess.getAttributeOperationsAccess();
    Iterator<AttributeOperation> itor = semanticObject.getAttributes().iterator();
    int index = 0;
    while(itor.hasNext()) {
      AttributeOperation ao = itor.next();
      if(index == 0) {
        feeder.accept(access.getAttributesAttributeOperationParserRuleCall_0_0(), ao, index);
      }
      else
        feeder.accept(access.getAttributesAttributeOperationParserRuleCall_1_0_1_0(), ao, index);
View Full Code Here


        if(result == null)
          result = defaultCase(theEObject);
        return result;
      }
      case PPPackage.ATTRIBUTE_OPERATION: {
        AttributeOperation attributeOperation = (AttributeOperation) theEObject;
        T result = caseAttributeOperation(attributeOperation);
        if(result == null)
          result = defaultCase(theEObject);
        return result;
      }
View Full Code Here

    assertTrue(message + ": expected instanceof: " + expected.getSimpleName() + " got: " +
        instance.getClass().getSimpleName(), expected.isAssignableFrom(instance.getClass()));
  }

  protected AttributeOperation createAttributeAddition(String name, Expression value) {
    AttributeOperation ao = pf.createAttributeOperation();
    ao.setKey(name);
    ao.setValue(value);
    ao.setOp("+>");
    return ao;
  }
View Full Code Here

  protected AttributeOperation createAttributeAddition(String name, String value) {
    return createAttributeAddition(name, createNameOrReference(value));
  }

  protected AttributeOperation createAttributeDefinition(String name, Expression value) {
    AttributeOperation ao = pf.createAttributeOperation();
    ao.setKey(name);
    ao.setValue(value);
    ao.setOp("=>");
    return ao;
  }
View Full Code Here

    ResourceBody rb = pf.createResourceBody();
    rb.setNameExpr(titleExpr);
    AttributeOperations aos = pf.createAttributeOperations();
    EList<AttributeOperation> aoList = aos.getAttributes();
    for(int i = 0; i < keyValPairs.length; i++) {
      AttributeOperation ao = pf.createAttributeOperation();
      ao.setOp(additive
          ? "+>"
          : "=>");
      if(!(keyValPairs[i] instanceof String))
        throw new IllegalArgumentException("Bad test spec, key not a String");
      ao.setKey((String) (keyValPairs[i++]));

      if(keyValPairs[i] instanceof String) {
        SingleQuotedString valueExpr = pf.createSingleQuotedString();
        valueExpr.setText((String) (keyValPairs[i]));
        ao.setValue(valueExpr);
      }
      else if(keyValPairs[i] instanceof Expression)
        ao.setValue((Expression) keyValPairs[i]);
      else
        throw new IllegalArgumentException("Bad test spec, keyValPair value neither String not expression");
      aoList.add(ao);
    }
    if(aos.getAttributes().size() > 0)
View Full Code Here

TOP

Related Classes of com.puppetlabs.geppetto.pp.AttributeOperation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.