Esempio n. 1
0
  @Override
  public List<PartBean> getPartsByOuput(Output output) throws XmlException {
    logger.debug("start public List<PartBean> getPartsByOuput(Output output)");
    List<PartBean> partBeanList = new ArrayList<PartBean>();
    List<Part> partList = output.getParts();

    if (!partList.isEmpty()) {
      for (Part p : partList) {
        PartBean partBean = new PartBean();
        partBean.setPartQName(p.getPartQName());
        //			partBean.setDocumentation(p.getDocumentation().getContent());
        partBean.setOtherAttributes(p.getOtherAttributes());
        partBean.setOtherElements(p.getOtherElements());
        logger.debug("Part QName : " + p.getPartQName());

        // type( one Part have one Type)
        ITypeDAO typeDAO = new TypeDAO();
        TypeBean typeBean = new TypeBean();
        typeBean = typeDAO.getTypeByPart(p);
        partBean.setType(typeBean);

        // set Element ( one Part have one Element )
        IElementDAO elementDAO = new ElementDAO();
        ElementBean elementBean = new ElementBean();
        elementBean = elementDAO.getElementByPart(p);
        partBean.setElement(elementBean);
        partBeanList.add(partBean);
      }
      logger.debug("end public List<PartBean> getPartsByOuput(Output output)");
      return partBeanList;
    } else {
      return null;
    }
  }
Esempio n. 2
0
  public ElementBean getElementByOutput(Output output) throws XmlException {
    logger.debug("start public ElementBean getElementByOutput(Output output)");

    ElementBean elementBean = new ElementBean();
    Element element = output.getElement();
    if (element != null) {
      elementBean.setQname(element.getQName());
      //	elementBean.setDocumentation(element.getDocumentation().getContent());
      elementBean.setForm(element.getForm());
      elementBean.setMaxOccurs(element.getMaxOccurs());
      elementBean.setMinOccurs(element.getMinOccurs());
      elementBean.setOtherAttributes(element.getOtherAttributes());
      elementBean.setRef(element.getRef());

      ITypeDAO typeDAO = new TypeDAO();
      TypeBean typeBean = new TypeBean();
      typeBean = typeDAO.getTypeByElement(element);
      elementBean.setType(typeBean);
    }
    logger.debug("end public ElementBean getElementByOutput(Output output)");
    return elementBean;
  }