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

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


      initializer.setSynthetic(true);
      element.setInitializer(initializer);
      holder.validate();
    }
    if (element instanceof PropertyInducingElementImpl) {
      PropertyInducingElementImpl variable = (PropertyInducingElementImpl) element;

      if (inFieldContext) {
        ((FieldElementImpl) variable).setStatic(matches(
            ((FieldDeclaration) node.getParent().getParent()).getStaticKeyword(),
            Keyword.STATIC));
      }

      PropertyAccessorElementImpl getter = new PropertyAccessorElementImpl(variable);
      getter.setGetter(true);

      currentHolder.addAccessor(getter);
      variable.setGetter(getter);

      if (!isFinal) {
        PropertyAccessorElementImpl setter = new PropertyAccessorElementImpl(variable);
        setter.setSetter(true);
        ParameterElementImpl parameter = new ParameterElementImpl(
            "_" + variable.getName(),
            variable.getNameOffset());
        parameter.setSynthetic(true);
        parameter.setParameterKind(ParameterKind.REQUIRED);
        setter.setParameters(new ParameterElement[] {parameter});

        currentHolder.addAccessor(setter);
        variable.setSetter(setter);
      }
    }
    return null;
  }
View Full Code Here


      collectAccessors(getters, setters, unit);
    }
    for (PropertyAccessorElement setter : setters) {
      PropertyAccessorElement getter = getters.get(setter.getDisplayName());
      if (getter != null) {
        PropertyInducingElementImpl variable = (PropertyInducingElementImpl) getter.getVariable();
        variable.setSetter(setter);
        ((PropertyAccessorElementImpl) setter).setVariable(variable);
      }
    }
  }
View Full Code Here

      type.setTypeArguments(definingClass.getType().getTypeArguments());
    }
    element.setType(type);
    if (element instanceof PropertyAccessorElement) {
      PropertyAccessorElement accessor = (PropertyAccessorElement) element;
      PropertyInducingElementImpl variable = (PropertyInducingElementImpl) accessor.getVariable();
      if (accessor.isGetter()) {
        variable.setType(type.getReturnType());
      } else if (variable.getType() == null) {
        Type[] parameterTypes = type.getNormalParameterTypes();
        if (parameterTypes != null && parameterTypes.length > 0) {
          variable.setType(parameterTypes[0]);
        }
      }
    }
    return null;
  }
View Full Code Here

TOP

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

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.