Examples of ClassItem


Examples of com.bj58.spat.gaea.serializer.component.ClassItem

    public static void InitTypeMap() {
        TypeIdMap.clear();
        IdTypeMap.clear();
        ArrayList<ClassItem> ClassList = new ArrayList<ClassItem>();
        ClassList.add(new ClassItem(1, DBNull.class));
        ClassList.add(new ClassItem(2, Object.class));
        ClassList.add(new ClassItem(3, Boolean.class, boolean.class));
        ClassList.add(new ClassItem(4, Character.class, char.class));
        ClassList.add(new ClassItem(5, Byte.class, byte.class));
        ClassList.add(new ClassItem(7, Short.class, short.class));
        ClassList.add(new ClassItem(9, Integer.class, int.class));
        ClassList.add(new ClassItem(11, Long.class, long.class));
        ClassList.add(new ClassItem(13, Float.class, float.class));
        ClassList.add(new ClassItem(14, Double.class, double.class));
        ClassList.add(new ClassItem(15, BigDecimal.class));
        ClassList.add(new ClassItem(16, Date.class, java.sql.Date.class, java.sql.Time.class, java.sql.Timestamp.class));
        ClassList.add(new ClassItem(18, String.class));
        ClassList.add(new ClassItem(19, List.class));
        ClassList.add(new ClassItem(22, GKeyValuePair.class));
        ClassList.add(new ClassItem(23, Array.class));
        ClassList.add(new ClassItem(24, Map.class));
        for (ClassItem item : ClassList) {
            int id = item.getTypeId();
            Class[] types = item.getTypes();
            for (Class c : types) {
                TypeIdMap.put(c, item);
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.component.ClassItem

                    String name = ann.name();
                    if (name.equals(StrHelper.EmptyString)) {
                        name = c.getSimpleName();
                    }
                    int typeId = StrHelper.GetHashcode(name);
                    TypeIdMap.put(c, new ClassItem(typeId, c));
                    IdTypeMap.put(typeId, new ClassItem(typeId, c));
                }
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.component.ClassItem

            typeId = 19;
        }else if(typeId == 25){
            typeId = 24;
        }
        /**************************************************/
        ClassItem ci = IdTypeMap.get(typeId);
        if (ci != null) {
            return ci.getType();
        }
        return null;
    }
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.component.ClassItem

        } else if (Map.class.isAssignableFrom(type)) {
            type = Map.class;
        } else if (List.class.isAssignableFrom(type)) {
            type = List.class;
        }
        ClassItem ci = TypeIdMap.get(type);
        if (ci != null) {
            typeId = ci.getTypeId();
        } else {
            GaeaSerializable ann = (GaeaSerializable) type.getAnnotation(GaeaSerializable.class);
            if (ann == null) {
                throw new DisallowedSerializeException(type);
            }
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.component.ClassItem

        }
        return typeId;
    }

    public static void setTypeMap(Class type, int typeId) {
        ClassItem ci = new ClassItem(typeId, type);
        TypeIdMap.put(type, ci);
        IdTypeMap.put(typeId, ci);
    }
View Full Code Here

Examples of com.sun.tahiti.grammar.ClassItem

   
   
    // insert a temporary class item.
    // maybe it shouldn't be temporary...
    GroupDeclExp g = (GroupDeclExp)body;
    ClassItem cls = reader.annGrammar.createClassItem(
      reader.computeTypeName(this,"class"), g.exp );
    cls.isTemporary = true;
    reader.setDeclaredLocationOf(cls);
    g.exp = cls;
   
View Full Code Here

Examples of com.sun.tahiti.grammar.ClassItem

          if( decl.substitutionAffiliation.exp instanceof InterfaceItem )
            // someone has already added an InterfaceItem. abort.
            return;
         
         
          ClassItem head = reader.getElementClass(decl.substitutionAffiliation);
         
          if(head==null)
            // this substitution head doesn't have a ClassItem.
            // there is something wrong. So abort now.
            return;
         
          // append "I" to the class name and use it.
          String className="";
          if( head.getPackageName()!=null )
            className = head.getPackageName()+".";
          className += "I"+head.getBareName();
         
          InterfaceItem ii =
            reader.annGrammar.createInterfaceItem( className,
              decl.substitutionAffiliation.exp );
          decl.substitutionAffiliation.exp = ii;
          reader.setDeclaredLocationOf(ii);
        }
      });
    }
   
    final String className = reader.computeTypeName(this,"class");
    if(className==null)    return body;  // abort
   
    /* add a ClassItem in the element declaration.
   
    decl.exp should be made from ChoiceExp, ElementDeclExps of
    substitution groups, and ElementDeclExp.XSElementExp.
    Or possibly nullSet (if there was an error or the element decl is abstract).
    */
    decl.exp = decl.exp.visit( new ExpressionVisitorExpression(){
     
      // do not touch those primitives.
      public Expression onRef( ReferenceExp exp ) { return exp; }
      public Expression onList( ListExp exp ) { return exp; }
      public Expression onData( DataExp exp ) { return exp; }
      public Expression onValue( ValueExp exp ) { return exp; }
      public Expression onMixed( MixedExp exp ) { return exp; }
      public Expression onEpsilon() { return Expression.epsilon; }
      public Expression onAnyString() { return Expression.anyString; }
      public Expression onNullSet() { return Expression.nullSet; }
      public Expression onSequence( SequenceExp exp ) { return exp; }
      public Expression onConcur( ConcurExp exp ) { return exp; }
      public Expression onOther( OtherExp exp ) { return exp; }
      public Expression onAttribute( AttributeExp exp ) { return exp; }
      public Expression onOneOrMore( OneOrMoreExp exp ) { return exp; }
      public Expression onInterleave( InterleaveExp exp ) { return exp; }
      public Expression onChoice( ChoiceExp exp ) {
        // recursively process choices.
        return reader.pool.createChoice( exp.exp1.visit(this), exp.exp2.visit(this) );
      }
      public Expression onElement( ElementExp exp ) {
        if( exp!=decl.body return exp;
        // this is the element that we are looking for.
        // wrap it by a ClassItem.
        ClassItem item = reader.annGrammar.createClassItem( className, exp );
        reader.setDeclaredLocationOf(item);
        reader.addElementClass( decl, item );
        return item;
      }
    });
View Full Code Here

Examples of org.encog.util.arrayutil.ClassItem

    this.actualHigh = 0;
    this.actualLow = 0;

    int index = 0;
    for (int i = classFrom; i < classTo; i++) {
      this.classes.add(new ClassItem("" + i, index++));
    }

  }
View Full Code Here

Examples of org.encog.util.arrayutil.ClassItem

    this.normalizedLow = low;
    this.actualHigh = 0;
    this.actualLow = 0;

    for (int i = 0; i < cls.length; i++) {
      this.classes.add(new ClassItem(cls[i], i));
    }

  }
View Full Code Here

Examples of org.encog.util.arrayutil.ClassItem

          || (norm.getAction() == NormalizationAction.SingleField)) {

        int index = 0;
        for (final AnalystClassItem item : f.getClassMembers()) {
          norm.getClasses().add(
              new ClassItem(item.getName(), index++));
        }
      }
    }
  }
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.