Examples of JProperty


Examples of com.googlecode.wicketwebbeans.model.api.JProperty

                    .propertyNames("address1", EMPTY, EMPTY,
                                   "address2", EMPTY, EMPTY, "city", "state", "zip")
            )
            // Customize certain properties from above.
            .properties(
                new JProperty("firstName").required(true).maxLength(10),
                new JProperty("lastName").required(true)
            )
            .actions( new JAction("save").confirm("Are you sure you want to save?") );
       
        BeanMetaData meta = new BeanMetaData(bean.getClass(), null, jbean, this, null, false);
        add( new BeanForm("beanForm", bean, meta) );
View Full Code Here

Examples of com.googlecode.wicketwebbeans.model.api.JProperty

        JBeans jbeans = new JBeans(
            new JBean(TestBean.class)
                .columns(1)
                .css("greenBeanBorder")
                .propertyNames("firstName", "lastName", "rows")
                .properties( new JProperty("firstName").css("purpleColor") ),
            new JBean(RowBean.class)
                .css("redBeanBorder")
                .dynamicCss("getRowCss")
                .properties( new JProperty("description").dynamicCss("getDescriptionCss") )
        );
       
        BeanMetaData meta = new BeanMetaData(bean.getClass(), null, jbeans, this, null, false);
        add( new BeanForm("beanForm", bean, meta) );
    }
View Full Code Here

Examples of com.googlecode.wicketwebbeans.model.api.JProperty

                .context("nofirstname")
                .actions(
                    new JAction("goToGlobal").ajax(true)
                )
                .properties(
                    new JProperty("action.goToGlobal"),
                    new JProperty("-action.clear"),
                    new JProperty("-action.global"),
                    new JProperty("firstName"),
                    new JProperty("lastName"),
                    new JProperty("operand1"),
                    new JProperty("operand2"),
                    new JProperty("result"),
                    new JProperty("number")
                ),
            new JBean(TestBean.class)
                .context("clearfirstname")
                .actions(
                    new JAction("clear").ajax(true)
                )
                .properties(
                    new JProperty("-action.goToGlobal"),
                    new JProperty("action.clear"),
                    new JProperty("-action.global"),
                    new JProperty("firstName").viewOnly(true),
                    new JProperty("lastName").viewOnly(true),
                    new JProperty("operand1"),
                    new JProperty("operand2"),
                    new JProperty("-result"),
                    new JProperty("-number")
                ),

            new JBean(TestBean.class)
                .context("global")
                .properties(
                    new JProperty("-action.goToGlobal"),
                    new JProperty("-action.clear"),
                    new JProperty("firstName"),
                    new JProperty("lastName").viewOnly(true),
                    new JProperty("operand1").viewOnly(true),
                    new JProperty("operand2").viewOnly(true),
                    new JProperty("result").viewOnly(true),
                    new JProperty("number").viewOnly(true)
                )

        );
        meta = new BeanMetaData(bean.getClass(), getContext(), jbeans, this, null, false);
        form = new BeanForm("beanForm", bean, meta);
View Full Code Here

Examples of com.googlecode.wicketwebbeans.model.api.JProperty

    List<Property> processProps(List<ParameterValueAST> values)
    {
        List<Property> jproperties = new ArrayList<Property>();
        for (ParameterValueAST value : values) {
            String elementName = value.getValue();
            JProperty jproperty = new JProperty(elementName);
            jproperties.add(jproperty);
            for (ParameterAST param : value.getParameters()) {
                jproperty.add(param.getName(), param.getValuesAsStrings());
            }
        }
       
        return jproperties;
    }
View Full Code Here

Examples of org.codehaus.jam.JProperty

out.println(""+className+"::"+className+"()");
out.println("{");

    List properties = getProperties();
    for (Iterator iter = properties.iterator(); iter.hasNext();) {
      JProperty property = (JProperty) iter.next();
          String value = toCppDefaultValue(property.getType());
          String propertyName = property.getSimpleName();
          String parameterName = decapitalize(propertyName);
out.println("    this->"+parameterName+" = "+value+" ;");
    }
out.println("}");
out.println("");
out.println(""+className+"::~"+className+"()");
out.println("{");
out.println("}");
out.println("");
out.println("unsigned char "+className+"::getDataStructureType()");
out.println("{");
out.println("    return "+className+"::TYPE ; ");
out.println("}");
    for (Iterator iter = properties.iterator(); iter.hasNext();) {
      JProperty property = (JProperty) iter.next();
          String type = toCppType(property.getType());
          String propertyName = property.getSimpleName();
          String parameterName = decapitalize(propertyName);
out.println("");
out.println("        ");
out.println(""+type+" "+className+"::get"+propertyName+"()");
out.println("{");
out.println("    return "+parameterName+" ;");
out.println("}");
out.println("");
out.println("void "+className+"::set"+propertyName+"("+type+" "+parameterName+")");
out.println("{");
out.println("    this->"+parameterName+" = "+parameterName+" ;");
out.println("}");
      }
out.println("");
out.println("int "+className+"::marshal(p<IMarshaller> marshaller, int mode, p<IOutputStream> ostream) throw (IOException)");
out.println("{");
out.println("    int size = 0 ;");
out.println("");
out.println("    size += "+baseClass+"::marshal(marshaller, mode, ostream) ; ");

    for (Iterator iter = properties.iterator(); iter.hasNext();) {
      JProperty property = (JProperty) iter.next();
          String marshalMethod = toMarshalMethodName(property.getType());
          String propertyName = decapitalize(property.getSimpleName());
out.println("    size += marshaller->"+marshalMethod+"("+propertyName+", mode, ostream) ; ");
      }
out.println("    return size ;");
out.println("}");
out.println("");
out.println("void "+className+"::unmarshal(p<IMarshaller> marshaller, int mode, p<IInputStream> istream) throw (IOException)");
out.println("{");
out.println("    "+baseClass+"::unmarshal(marshaller, mode, istream) ; ");
    for (Iterator iter = properties.iterator(); iter.hasNext();) {
      JProperty property = (JProperty) iter.next();
          String cast = toUnmarshalCast(property.getType());
          String unmarshalMethod = toUnmarshalMethodName(property.getType());
          String propertyName = decapitalize(property.getSimpleName());
out.println("    "+propertyName+" = "+cast+"(marshaller->"+unmarshalMethod+"(mode, istream)) ; ");
      }
out.println("}");
  }
View Full Code Here

Examples of org.codehaus.jam.JProperty

    protected int generateMarshal1Body(PrintWriter out) {
        List properties = getProperties();
        int baseSize = 0;
        for (Iterator iter = properties.iterator(); iter.hasNext();) {
            JProperty property = (JProperty) iter.next();
            JAnnotation annotation = property.getAnnotation("openwire:property");
            JAnnotationValue size = annotation.getValue("size");
            JClass propertyType = property.getType();
            String type = propertyType.getSimpleName();
            String getter = "info." + property.getGetter().getSimpleName() + "()";

            out.print(indent);
            if (type.equals("boolean")) {
                out.println("bs.writeBoolean(" + getter + ");");
            }
View Full Code Here

Examples of org.codehaus.jam.JProperty

    }

    protected void generateMarshal2Body(PrintWriter out) {
        List properties = getProperties();
        for (Iterator iter = properties.iterator(); iter.hasNext();) {
            JProperty property = (JProperty) iter.next();
            JAnnotation annotation = property.getAnnotation("openwire:property");
            JAnnotationValue size = annotation.getValue("size");
            JClass propertyType = property.getType();
            String type = propertyType.getSimpleName();
            String getter = "info." + property.getGetter().getSimpleName() + "()";

            out.print(indent);
            if (type.equals("boolean")) {
                out.println("bs.readBoolean();");
            }
View Full Code Here

Examples of org.codehaus.jam.JProperty

out.println("#include <string>");
out.println("#include \"activemq/command/"+baseClass+".hpp\"");

    List properties = getProperties();
    for (Iterator iter = properties.iterator(); iter.hasNext();) {
      JProperty property = (JProperty) iter.next();
        if( !property.getType().isPrimitiveType() &&
            !property.getType().getSimpleName().equals("String") &&
            !property.getType().getSimpleName().equals("ByteSequence") )
        {
            String includeName = toCppType(property.getType());
            if( property.getType().isArrayType() )
            {
                JClass arrayType = property.getType().getArrayComponentType();
                if( arrayType.isPrimitiveType() )
                    continue ;
            }
            if( includeName.startsWith("array<") )
                includeName = includeName.substring(6, includeName.length()-1);
            else if( includeName.startsWith("p<") )
                includeName = includeName.substring(2, includeName.length()-1);
   
            if( includeName.equals("IDataStructure") ) {
out.println("#include \"activemq/"+includeName+".hpp\"");
        else {
out.println("#include \"activemq/command/"+includeName+".hpp\"");
        }
        }
    }
out.println("");
out.println("#include \"activemq/protocol/IMarshaller.hpp\"");
out.println("#include \"ppr/io/IOutputStream.hpp\"");
out.println("#include \"ppr/io/IInputStream.hpp\"");
out.println("#include \"ppr/io/IOException.hpp\"");
out.println("#include \"ppr/util/ifr/array\"");
out.println("#include \"ppr/util/ifr/p\"");
out.println("");
out.println("namespace apache");
out.println("{");
out.println("  namespace activemq");
out.println("  {");
out.println("    namespace command");
out.println("    {");
out.println("      using namespace ifr;");
out.println("      using namespace std;");
out.println("      using namespace apache::activemq;");
out.println("      using namespace apache::activemq::protocol;");
out.println("      using namespace apache::ppr::io;");
out.println("");
out.println("/*");
out.println(" *");
out.println(" *  Command and marshalling code for OpenWire format for "+className+"");
out.println(" *");
out.println(" *");
out.println(" *  NOTE!: This file is autogenerated - do not modify!");
out.println(" *         if you need to make a change, please see the Groovy scripts in the");
out.println(" *         activemq-core module");
out.println(" *");
out.println(" */");
out.println("class "+className+" : public "+baseClass+"");
out.println("{");
out.println("protected:");

    for (Iterator iter = properties.iterator(); iter.hasNext();) {
      JProperty property = (JProperty) iter.next();
          String type = toCppType(property.getType());
          String name = decapitalize(property.getSimpleName());
out.println("    "+type+" "+name+" ;");
      }
out.println("");
out.println("public:");
out.println("    const static unsigned char TYPE = "+getOpenWireOpCode(jclass)+";");
out.println("");
out.println("public:");
out.println("    "+className+"() ;");
out.println("    virtual ~"+className+"() ;");
out.println("");
out.println("    virtual unsigned char getDataStructureType() ;");

    for (Iterator iter = properties.iterator(); iter.hasNext();) {
      JProperty property = (JProperty) iter.next();
          String type = toCppType(property.getType());
          String propertyName = property.getSimpleName();
          String parameterName = decapitalize(propertyName);
out.println("");
out.println("    virtual "+type+" get"+propertyName+"() ;");
out.println("    virtual void set"+propertyName+"("+type+" "+parameterName+") ;");
      }
View Full Code Here

Examples of org.codehaus.jam.JProperty

  }

  protected void generateTightUnmarshalBody(PrintWriter out) {
    List properties = getProperties();
    for (Iterator iter = properties.iterator(); iter.hasNext();) {
      JProperty property = (JProperty) iter.next();
      JAnnotation annotation = property.getAnnotation("openwire:property");
      JAnnotationValue size = annotation.getValue("size");
      JClass propertyType = property.getType();
      String propertyTypeName = propertyType.getSimpleName();

      if (propertyType.isArrayType() && !propertyTypeName.equals("byte[]")) {
        generateTightUnmarshalBodyForArrayProperty(out, property, size);
      } else {
View Full Code Here

Examples of org.codehaus.jam.JProperty

  protected int generateTightMarshal1Body(PrintWriter out) {
    List properties = getProperties();
    int baseSize = 0;
    for (Iterator iter = properties.iterator(); iter.hasNext();) {
      JProperty property = (JProperty) iter.next();
      JAnnotation annotation = property.getAnnotation("openwire:property");
      JAnnotationValue size = annotation.getValue("size");
      JClass propertyType = property.getType();
      String type = propertyType.getSimpleName();
      String getter = "info." + property.getGetter().getSimpleName() + "()";

      if (type.equals("boolean")) {
        out.println("        bs.writeBoolean(" + getter + ");");
      } else if (type.equals("byte")) {
        baseSize += 1;
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.