Package org.apache.muse.tools.inspector

Examples of org.apache.muse.tools.inspector.JavaProperty


   * @return
   *         A wrapped version of the property containing its QName and
   *         corresponding java class.
   */
  private JavaProperty makeJavaProperty(QName property, ResourceInspector inspector) {
    JavaProperty javaProperty = new JavaProperty();
   
    javaProperty.setQName(property);
    javaProperty.setJavaType(inspector.getPropertyType(property));
   
    return javaProperty;
  }
View Full Code Here


    indent(code);
    generateOpenBlock(code);
    newLine(code);
   
    for(Iterator i=capability.getProperties().iterator(); i.hasNext();) {
      JavaProperty property = (JavaProperty)i.next();
      indent(2,code);
      code.append("new "
        + convertType(QName.class, classInfo)
        + "(NAMESPACE_URI, \""
        + getPropertyName(property, false)
        + "\", PREFIX)");
      if(i.hasNext()) {
        code.append(",");
      }
      newLine(code);
    }
   
    indent(code);
    generateCloseBlock(code);
    statement(";",code);
    newLine(2,code);
   
    indent(code);
    code.append("public "
      + convertType(QName.class, classInfo)
      + "[] getPropertyNames()");
    newLine(code);
   
    indent(code);
    generateOpenBlock(code);
    newLine(code);
   
    indent(2,code);
    code.append("return _PROPERTIES;");
   
    newLine(code);
    indent(code);
    generateCloseBlock(code);
    newLine(2,code);
   
    for(Iterator i=capability.getProperties().iterator(); i.hasNext();) {
      JavaProperty property = (JavaProperty)i.next();
      indent(code);
      code.append("private "
        + convertType(property.getJavaType(), classInfo)
        + " _"
        + getPropertyName(property, false)
        + ";");
      newLine(2, code);
    }
View Full Code Here

    if(capability.getProperties().size() == 0) {
      return;
    }
   
    for(Iterator i=capability.getProperties().iterator(); i.hasNext();) {
      JavaProperty property = (JavaProperty)i.next();
      indent(code);
      code.append("public "
        + convertType(property.getJavaType(), classInfo)
        + " get"
        + getPropertyName(property, true)
        + "()");
     
      if(generateBody) {
        newLine(code);
        indent(code);
        generateOpenBlock(code);
        newLine(code);
       
        indent(2,code);
        statement("return _"
          + getPropertyName(property, false)
          ";",code);
        newLine(code);
       
        indent(code);
        generateCloseBlock(code);
      } else {
        code.append(";");
      }
      newLine(2,code);
     
      indent(code);
      code.append("public void");
      code.append(" set"
        + getPropertyName(property, true)
        + "("
        + convertType(property.getJavaType(), classInfo)
        + " param0)");
     
      if(generateBody) {
        newLine(code);
        indent(code);
View Full Code Here

        addImport(parameterTypes[j]);
      }
    }
   
    for(Iterator i = _capability.getProperties().iterator(); i.hasNext(); ) {
      JavaProperty property = (JavaProperty)i.next();
      addImport(property.getJavaType());
    }
  }
View Full Code Here

    indent(code);
    generateOpenBlock(code);
    newLine(code);
   
    for(Iterator i=capability.getProperties().iterator(); i.hasNext();) {
      JavaProperty property = (JavaProperty)i.next();
      indent(2,code);
      code.append("new "
        + convertType(QName.class, classInfo)
        + "(NAMESPACE_URI, \""
        + getPropertyName(property, false)
        + "\", PREFIX)");
      if(i.hasNext()) {
        code.append(",");
      }
      newLine(code);
    }
   
    indent(code);
    generateCloseBlock(code);
    statement(";",code);
    newLine(2,code);
   
    indent(code);
    code.append("public "
      + convertType(QName.class, classInfo)
      + "[] getPropertyNames()");
    newLine(code);
   
    indent(code);
    generateOpenBlock(code);
    newLine(code);
   
    indent(2,code);
    code.append("return _PROPERTIES;");
   
    newLine(code);
    indent(code);
    generateCloseBlock(code);
    newLine(2,code);
   
    for(Iterator i=capability.getProperties().iterator(); i.hasNext();) {
      JavaProperty property = (JavaProperty)i.next();
      indent(code);
      code.append("private "
        + convertType(property.getJavaType(), classInfo)
        + " _"
        + getPropertyName(property, false)
        + ";");
      newLine(2, code);
    }
View Full Code Here

    indent(2, code);
    code.append("//");
    newLine(code);
   
    for(Iterator i = classInfo.getCapability().getProperties().iterator(); i.hasNext(); ) {
      JavaProperty property = (JavaProperty)i.next();
      if(!property.getJavaType().isPrimitive()) {
        indent(2, code);
        code.append("// " + property.getName().getLocalPart());
        newLine(code);   
      }
    }
   
    indent(2, code);
View Full Code Here

   * @return
   *         A wrapped version of the property containing its QName and
   *         corresponding java class.
   */
  private JavaProperty makeJavaProperty(QName property, ResourceInspector inspector) {
    JavaProperty javaProperty = new JavaProperty();
   
    javaProperty.setQName(property);
    javaProperty.setJavaType(inspector.getPropertyType(property));   
       
    MetadataDescriptor metadata = inspector.getMetadata();
   
    //
    // Need to check to see if the metadata document
    // has the given property. This isn't always true since metadata
    // is optional
    //
    if(!metadata.hasProperty(property)) {
      metadata = OpenMetadataDescriptor.getInstance();
    }
   
    javaProperty.setMetadata(metadata);
   
    return javaProperty;
  }
View Full Code Here

    }

    i = classInfo.getCapability().getProperties().iterator();

    while (i.hasNext()) {
      JavaProperty property = (JavaProperty) i.next();

      generatePropertyGet(property, classInfo, getIndex(), code);
      if (property.isAppendable())
        generatePropertyInsert(property, classInfo, getIndex(), code);

      if (property.isMutable()) {
        generatePropertyUpdate(property, classInfo, getIndex(), code);
        generatePropertyDelete(property, classInfo, getIndex(), code);
      }

      incrementIndex();
View Full Code Here

        addImport(parameterTypes[j]);
      }
    }
   
    for(Iterator i = _capability.getProperties().iterator(); i.hasNext(); ) {
      JavaProperty property = (JavaProperty)i.next();
      addImport(property.getJavaType());
    }
  }
View Full Code Here

    return _capability;
  }

  public boolean needsInitializer() {
    for(Iterator i = _capability.getProperties().iterator(); i.hasNext(); ) {
      JavaProperty next = (JavaProperty)i.next();
      if(!next.getJavaType().isPrimitive()) {
        return true;
      }
    }
   
    return _capability.isEmpty();
View Full Code Here

TOP

Related Classes of org.apache.muse.tools.inspector.JavaProperty

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.