Package br.net.woodstock.rockframework.xml.dom

Examples of br.net.woodstock.rockframework.xml.dom.XmlElement


  }

  private void addPrivateKeyElement(final XmlElement parent, final String alias, final Identity identity) throws CertificateEncodingException, UnsupportedEncodingException {
    PrivateKey privateKey = identity.getPrivateKey();
    Certificate[] chain = identity.getChain();
    XmlElement privateKeyElement = parent.addElement(XMLStore.PRIVATE_KEY_ELEMENT);
    XmlElement chainElement = privateKeyElement.addElement(XMLStore.CHAIN_ELEMENT);
    privateKeyElement.setAttribute(XMLStore.ALIAS_ATTRIBUTE, alias);
    privateKeyElement.setAttribute(XMLStore.ALGORITHM_ATTRIBUTE, privateKey.getAlgorithm());

    this.setBase64Data(privateKeyElement, privateKey.getEncoded());
View Full Code Here


      }
    }
  }

  private void addPublicKeyElement(final XmlElement parent, final String alias, final PublicKey publicKey) throws UnsupportedEncodingException {
    XmlElement publicKeyElement = parent.addElement(XMLStore.PUBLIC_KEY_ELEMENT);
    publicKeyElement.setAttribute(XMLStore.ALIAS_ATTRIBUTE, alias);
    publicKeyElement.setAttribute(XMLStore.ALGORITHM_ATTRIBUTE, publicKey.getAlgorithm());

    this.setBase64Data(publicKeyElement, publicKey.getEncoded());
  }
View Full Code Here

    this.setBase64Data(publicKeyElement, publicKey.getEncoded());
  }

  private void addSecretKeyElement(final XmlElement parent, final String alias, final SecretKey secretKey) throws UnsupportedEncodingException {
    XmlElement publicKeyElement = parent.addElement(XMLStore.SECRET_KEY_ELEMENT);
    publicKeyElement.setAttribute(XMLStore.ALIAS_ATTRIBUTE, alias);
    publicKeyElement.setAttribute(XMLStore.ALGORITHM_ATTRIBUTE, secretKey.getAlgorithm());

    this.setBase64Data(publicKeyElement, secretKey.getEncoded());
  }
View Full Code Here

    this.addColumn(element, propertyDescriptor, column);
    return element;
  }

  private XmlElement addId(final XmlElement parent, final PropertyDescriptor propertyDescriptor) {
    XmlElement element = parent.addElement("id");
    element.setAttribute("name", propertyDescriptor.getName());

    if (propertyDescriptor.isAnnotationPresent(Column.class)) {
      Column c = propertyDescriptor.getAnnotation(Column.class);
      this.addColumn(element, propertyDescriptor, c);
    }
View Full Code Here

    }
    return element;
  }

  private XmlElement addTransient(final XmlElement parent, final PropertyDescriptor propertyDescriptor) {
    XmlElement element = parent.addElement("transient");
    element.setAttribute("name", propertyDescriptor.getName());
    return element;
  }
View Full Code Here

    element.setAttribute("name", propertyDescriptor.getName());
    return element;
  }

  private XmlElement addJoinTable(final XmlElement parent, final JoinTable joinTable) {
    XmlElement element = parent.addElement("join-table");
    element.setAttribute("name", joinTable.name());
    if (ConditionUtils.isNotEmpty(joinTable.schema())) {
      element.setAttribute("schema", joinTable.schema());
    }
    for (JoinColumn jc : joinTable.joinColumns()) {
      this.addJoinColumn(element, jc);
    }
    for (JoinColumn jc : joinTable.inverseJoinColumns()) {
View Full Code Here

    }
    return element;
  }

  private XmlElement addColumn(final XmlElement parent, final PropertyDescriptor propertyDescriptor, final Column column) {
    XmlElement element = parent.addElement("column");
    element.setAttribute("name", column.name());
    element.setAttribute("nullable", Boolean.toString(column.nullable()));

    if (propertyDescriptor.getType() == String.class) {
      element.setAttribute("length", Integer.toString(column.length()));
    } else if (Number.class.isAssignableFrom(propertyDescriptor.getType())) {
      if (column.scale() > 0) {
        element.setAttribute("scale", Integer.toString(column.scale()));
      }
      if (column.precision() > 0) {
        element.setAttribute("precision", Integer.toString(column.precision()));
      }
    }

    if (propertyDescriptor.isAnnotationPresent(Temporal.class)) {
      Temporal t = propertyDescriptor.getAnnotation(Temporal.class);
View Full Code Here

    }
    return element;
  }

  private XmlElement addJoinColumn(final XmlElement parent, final JoinColumn joinColumn) {
    XmlElement element = parent.addElement("join-column");
    element.setAttribute("name", joinColumn.name());
    element.setAttribute("referenced-column-name", joinColumn.referencedColumnName());
    element.setAttribute("nullable", Boolean.toString(joinColumn.nullable()));
    return element;
  }
View Full Code Here

    element.setAttribute("nullable", Boolean.toString(joinColumn.nullable()));
    return element;
  }

  private XmlElement addInverseJoinColumn(final XmlElement parent, final JoinColumn joinColumn) {
    XmlElement element = parent.addElement("inverse-join-column");
    element.setAttribute("name", joinColumn.name());
    element.setAttribute("referenced-column-name", joinColumn.referencedColumnName());
    element.setAttribute("nullable", Boolean.toString(joinColumn.nullable()));
    return element;
  }
View Full Code Here

    element.setAttribute("nullable", Boolean.toString(joinColumn.nullable()));
    return element;
  }

  private XmlElement addCascades(final XmlElement parent, final CascadeType[] cascades) {
    XmlElement element = parent.addElement("cascades");
    for (CascadeType c : cascades) {
      element.addElement("cascade-" + c.name().toLowerCase());
    }
    return element;
  }
View Full Code Here

TOP

Related Classes of br.net.woodstock.rockframework.xml.dom.XmlElement

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.