Package org.apache.ws.jaxme.generator.sg

Examples of org.apache.ws.jaxme.generator.sg.PropertySG


      throws SAXException {
    for (Iterator iter = pColumns;  iter.hasNext()) {
      Column col = (Column) iter.next();
      CustomColumnData colData = (CustomColumnData) col.getCustomData();
      Object sg = colData.getSG();
      PropertySG propertySG;
      TypeSG typeSG;
      if (sg instanceof AttributeSG) {
        AttributeSG attrSG = (AttributeSG) sg;
        propertySG = attrSG.getPropertySG();
        typeSG = attrSG.getTypeSG();
      } else if (sg instanceof ParticleSG) {
        ParticleSG particleSG = (ParticleSG) sg;
        propertySG = particleSG.getPropertySG();
        typeSG = particleSG.getObjectSG().getTypeSG();
      } else {
        throw new IllegalStateException("Invalid SG type for column " + col.getName() + ": " + sg);
      }
      Object value = propertySG.getValue(pElement);
      setPreparedStatementValue(pMethod, col, pStmt, new Integer(++pParamNum), value, typeSG);
    }
    return pParamNum;
  }
View Full Code Here


      throws SAXException {
    for (Iterator iter = pColumns;  iter.hasNext()) {
      Column col = (Column) iter.next();
      CustomColumnData colData = (CustomColumnData) col.getCustomData();
      Object sg = colData.getSG();
      PropertySG propertySG;
      TypeSG typeSG;
      if (sg instanceof AttributeSG) {
        AttributeSG attrSG = (AttributeSG) sg;
        propertySG = attrSG.getPropertySG();
        typeSG = attrSG.getTypeSG();
      } else if (sg instanceof ParticleSG) {
        ParticleSG particleSG = (ParticleSG) sg;
        propertySG = particleSG.getPropertySG();
        typeSG = particleSG.getObjectSG().getTypeSG();
      } else {
        throw new IllegalStateException("Invalid SG type for column " + col.getName() + ": " + sg);
      }
      Object value = getResultSetValue(pMethod, col, pRs, new Integer(++pParamNum), typeSG);
      propertySG.setValue(pMethod, pElement, value, null);
    }
    return pParamNum;
  }
View Full Code Here

    log.finest(mName, "->", pSource.getQName());
    ParticleSG[] myParticles = pController.getParticles();
    for (int i = 0;  i < particles.length;  i++) {
      ParticleSG particle = myParticles[i];
      if (particle.isElement()) {
        PropertySG elementSG = particle.getPropertySG();
        elementSG.generate(pSource);
      } else if (particle.isGroup()) {
        // TODO: Implement groups referencing groups
        throw new LocSAXException("Nested groups are yet unsupported", particle.getLocator());
      } else if (particle.isWildcard()) {
        // TODO: Implement Wildcard handling
View Full Code Here

  }

  public void forAllNonNullValues(ParticleSG pController, JavaMethod pMethod,
                                   DirectAccessible pElement, SGlet pSGlet) throws SAXException {
    if (pController.isElement()) {
      PropertySG pSG = pController.getPropertySG();
      boolean hasIsSetMethod = pSG.hasIsSetMethod();
      if (hasIsSetMethod) {
        pMethod.addIf(pSG.getXMLIsSetMethodName(), "()");
      }
      TypeSG typeSG = pController.getObjectSG().getTypeSG();
      Object v = pController.getPropertySG().getValue(pElement);
      if (typeSG.isComplex()) {
        pSGlet.generate(pMethod, v);
View Full Code Here

      throws SAXException {
    for (Iterator iter = pColumns;  iter.hasNext()) {
      Column col = (Column) iter.next();
      CustomColumnData colData = (CustomColumnData) col.getCustomData();
      Object sg = colData.getSG();
      PropertySG propertySG;
      TypeSG typeSG;
      if (sg instanceof AttributeSG) {
        AttributeSG attrSG = (AttributeSG) sg;
        propertySG = attrSG.getPropertySG();
        typeSG = attrSG.getTypeSG();
      } else if (sg instanceof ParticleSG) {
        ParticleSG particleSG = (ParticleSG) sg;
        propertySG = particleSG.getPropertySG();
        typeSG = particleSG.getObjectSG().getTypeSG();
      } else {
        throw new IllegalStateException("Invalid SG type for column " + col.getName() + ": " + sg);
      }
      Object value = propertySG.getValue(pElement);
      setPreparedStatementValue(pMethod, col, pStmt, new Integer(++pParamNum), value, typeSG);
    }
    return pParamNum;
  }
View Full Code Here

      throws SAXException {
    for (Iterator iter = pColumns;  iter.hasNext()) {
      Column col = (Column) iter.next();
      CustomColumnData colData = (CustomColumnData) col.getCustomData();
      Object sg = colData.getSG();
      PropertySG propertySG;
      TypeSG typeSG;
      if (sg instanceof AttributeSG) {
        AttributeSG attrSG = (AttributeSG) sg;
        propertySG = attrSG.getPropertySG();
        typeSG = attrSG.getTypeSG();
      } else if (sg instanceof ParticleSG) {
        ParticleSG particleSG = (ParticleSG) sg;
        propertySG = particleSG.getPropertySG();
        typeSG = particleSG.getObjectSG().getTypeSG();
      } else {
        throw new IllegalStateException("Invalid SG type for column " + col.getName() + ": " + sg);
      }
      Object value = getResultSetValue(pMethod, col, pRs, new Integer(++pParamNum), typeSG);
      propertySG.setValue(pMethod, pElement, value, null);
    }
    return pParamNum;
  }
View Full Code Here

    log.finest(mName, "->", pSource.getQName());
    ParticleSG[] myParticles = pController.getParticles();
    for (int i = 0;  i < particles.length;  i++) {
      ParticleSG particle = myParticles[i];
      if (particle.isElement()) {
        PropertySG elementSG = particle.getPropertySG();
        elementSG.generate(pSource);
      } else if (particle.isGroup()) {
        GroupSG groupSG = particle.getGroupSG();
        groupSG.generateProperties(pSource);
      } else if (particle.isWildcard()) {
        PropertySG wildcardSG = particle.getPropertySG();
        wildcardSG.generate(pSource);
      } else {
        throw new IllegalStateException("Unknown particle type: Neither of element, group, or wildcard");
      }
    }
    log.finest(mName, "<-");
View Full Code Here

      throws SAXException {
    for (Iterator iter = pColumns;  iter.hasNext()) {
      Column col = (Column) iter.next();
      CustomColumnData colData = (CustomColumnData) col.getCustomData();
      Object sg = colData.getSG();
      PropertySG propertySG;
      TypeSG typeSG;
      if (sg instanceof AttributeSG) {
        AttributeSG attrSG = (AttributeSG) sg;
        propertySG = attrSG.getPropertySG();
        typeSG = attrSG.getTypeSG();
      } else if (sg instanceof ParticleSG) {
        ParticleSG particleSG = (ParticleSG) sg;
        propertySG = particleSG.getPropertySG();
        typeSG = particleSG.getObjectSG().getTypeSG();
      } else {
        throw new IllegalStateException("Invalid SG type for column " + col.getName() + ": " + sg);
      }
      Object value = propertySG.getValue(pElement);
      setPreparedStatementValue(pMethod, col, pStmt, new Integer(++pParamNum), value, typeSG);
    }
    return pParamNum;
  }
View Full Code Here

      throws SAXException {
    for (Iterator iter = pColumns;  iter.hasNext()) {
      Column col = (Column) iter.next();
      CustomColumnData colData = (CustomColumnData) col.getCustomData();
      Object sg = colData.getSG();
      PropertySG propertySG;
      TypeSG typeSG;
      if (sg instanceof AttributeSG) {
        AttributeSG attrSG = (AttributeSG) sg;
        propertySG = attrSG.getPropertySG();
        typeSG = attrSG.getTypeSG();
      } else if (sg instanceof ParticleSG) {
        ParticleSG particleSG = (ParticleSG) sg;
        propertySG = particleSG.getPropertySG();
        typeSG = particleSG.getObjectSG().getTypeSG();
      } else {
        throw new IllegalStateException("Invalid SG type for column " + col.getName() + ": " + sg);
      }
      Object value = getResultSetValue(pMethod, col, pRs, new Integer(++pParamNum), typeSG);
      propertySG.setValue(pMethod, pElement, value, null);
    }
    return pParamNum;
  }
View Full Code Here

    }

    public void forAllNonNullValues(ParticleSG pController, JavaMethod pMethod,
                  DirectAccessible pElement, SGlet pSGlet) throws SAXException {
        if (pController.isElement()) {
            PropertySG pSG = pController.getPropertySG();
            boolean hasIsSetMethod = pSG.hasIsSetMethod();
            if (hasIsSetMethod) {
                pMethod.addIf(pSG.getXMLIsSetMethodName(), "()");
            }
            TypeSG typeSG = pController.getObjectSG().getTypeSG();
            Object v = pController.getPropertySG().getValue(pElement);
            if (typeSG.isComplex()) {
                pSGlet.generate(pMethod, v);
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.generator.sg.PropertySG

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.