Package com.google.dart.engine.internal.element

Examples of com.google.dart.engine.internal.element.ConstFieldElementImpl


    VariableElementImpl element;
    if (inFieldContext) {
      SimpleIdentifier fieldName = node.getName();
      FieldElementImpl field;
      if (isConst && hasInitializer) {
        field = new ConstFieldElementImpl(fieldName);
      } else {
        field = new FieldElementImpl(fieldName);
      }
      element = field;
View Full Code Here


    //
    NodeList<EnumConstantDeclaration> constants = node.getConstants();
    int constantCount = constants.size();
    for (int i = 0; i < constantCount; i++) {
      SimpleIdentifier constantName = constants.get(i).getName();
      FieldElementImpl constantField = new ConstFieldElementImpl(constantName);
      constantField.setStatic(true);
      constantField.setConst(true);
      constantField.setType(enumType);
      //
      // Create a value for the constant.
      //
      HashMap<String, DartObjectImpl> fieldMap = new HashMap<String, DartObjectImpl>();
      fieldMap.put(indexFieldName, new DartObjectImpl(intType, new IntState(BigInteger.valueOf(i))));
      DartObjectImpl value = new DartObjectImpl(enumType, new GenericState(fieldMap));
      constantField.setEvaluationResult(new ValidResult(value));
      fields.add(constantField);
      getters.add(createGetter(constantField));
      constantName.setStaticElement(constantField);
    }
    //
View Full Code Here

TOP

Related Classes of com.google.dart.engine.internal.element.ConstFieldElementImpl

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.