Examples of ITypeNode


Examples of org.apache.flex.compiler.tree.as.ITypeNode

        return null;
    }

    private static ITypeDefinition getTypeDefinition(IDefinitionNode node)
    {
        ITypeNode tnode = (ITypeNode) node.getAncestorOfType(ITypeNode.class);
        return (ITypeDefinition) tnode.getDefinition();
    }
View Full Code Here

Examples of org.destecs.tools.jprotocolgenerator.ast.ITypeNode

    Map<String, ClassDefinition> structs = new Hashtable<String, ClassDefinition>();

    for (String key : type.possibleEntries.keySet())
    {
      ITypeNode t = type.possibleEntries.get(key);
      if ((t instanceof ListType
          && ((ListType) t).type instanceof MapType || t instanceof MapType))
      {

        ClassDefinition pClass = new ClassDefinition();
        pClass.setName(m.name + key + "StructParam");
        pClass.packageName = structPackageName;
        pClass.imports.add(new Type(Map.class));
        pClass.imports.add(new Type(List.class));
        pClass.implemented.add(stryctInterface);
        defs.add(pClass);
        structs.put(key, pClass);
        MapType mType = null;
        if (t instanceof ListType)
        {
          mType = (MapType) ((ListType) t).type;
        } else
        {
          mType = (MapType) t;
        }
        defs.addAll(generateStructs(pClass, structPackageName, mType));

        if (t instanceof ListType)
        {
          sb.append("List<" + pClass.getName() + ">");
        } else
        {

          sb.append(pClass.getName());
        }
      } else
      {

        sb.append(type.possibleEntries.get(key).toSource());
      }
      sb.append(" ");
      sb.append(key);
      sb.append(",");
    }
    if (type.possibleEntries.size() > 0)
    {
      sb.deleteCharAt(sb.length() - 1);
    }

    sb.append(")");

    if (!m.throwsTypes.isEmpty())
    {
      sb.append(m.getThrowsSourceSegment());
    }

    sb.append("\n\t{");

    sb.append("\n\t\t" + p1.type.toSource() + " data = new "
        + p1.type.toSource().replaceFirst("Map", "Hashtable") + "();");

    Integer pCount = 0;
    for (String key : type.possibleEntries.keySet())
    {

      if (structs.containsKey(key))
      {
        ITypeNode t = ((MapType) p1.type).valueType;
        if (t.getName().contains(Object.class.getSimpleName()))
        {
          t = new ListType(new Type(Object.class));
        }

        MapType mapt = ((MapType) p1.type);
        if (mapt.valueType instanceof ListType)
        {
          sb.append("\n\n\t\tList<"
              + ((ListType) mapt.valueType).type.toSource()
              + "> pTmp"
              + pCount
              + (" = new List<"
                  + ((ListType) mapt.valueType).type.toSource() + ">").replace("List", "Vector")
              + "();");
        } else
        {

          sb.append("\n\n\t\t@SuppressWarnings(\"rawtypes\")");
          sb.append("\n\n\t\t" + t.toSource() + " pTmp" + pCount
              + " = new "
              + t.toSource().replace("List", "Vector") + "();");
        }

        sb.append("\n\t\tfor( IStruct a: " + key + ")");
        sb.append("\n\t\t{");
View Full Code Here

Examples of org.destecs.tools.jprotocolgenerator.ast.ITypeNode

    {
      Field f = new Field();
      f.setName(p);
      returnClass.fields.add(f);

      ITypeNode type = map.possibleEntries.get(p);
      if (type instanceof ListType)
      {
        if (((ListType) type).type instanceof MapType)
        {
          swa.warnings.add(WarningTypes.unchecked);
View Full Code Here

Examples of org.destecs.tools.jprotocolgenerator.ast.ITypeNode

    } else
    {

      Element typeNode = getFirstChildElement(value);

      ITypeNode type = getType(typeNode);

      if (isReturn)
      {
        return new Parameter(type);
      } else
View Full Code Here

Examples of org.destecs.tools.jprotocolgenerator.ast.ITypeNode

    StringBuilder sb = new StringBuilder();

    sb.append(List.class.getSimpleName() + "<");

    ITypeNode rangeType = null;
    for (Element value : getElements(data.getChildNodes()))
    {
      if (value.getNodeName().equals(TAG_VALUE))
      {
        Element nextedTypeElement = getFirstChildElement(value);
        if (rangeType == null)
        {
          rangeType = getType(nextedTypeElement);
        } else if (!rangeType.equals(getType(nextedTypeElement)))
        {
          rangeType = new Type(Object.class);
          break;
        }
      }
View Full Code Here

Examples of org.destecs.tools.jprotocolgenerator.ast.ITypeNode

    sb.append(Map.class.getSimpleName());
    sb.append("<");
    sb.append(String.class.getSimpleName());
    sb.append(",");

    ITypeNode rangeType = null;
    for (Element member : getElements(typeNode.getChildNodes()))
    {
      if (member.getNodeName().equals(TAG_MEMBER))
      {
        String possibleName = null;
        ITypeNode possibleType = null;

        for (Element value : getElements(member.getChildNodes()))
        {
          if (value.getNodeName().equals(TAG_VALUE))
          {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.