Examples of ComplexProperty


Examples of org.apache.olingo.odata2.api.edm.provider.ComplexProperty

      return sp;
    }

    private Property createComplexProperty(final Field field, final String defaultNamespace) {
      ComplexProperty cp = new ComplexProperty();
      // settings from property
      String entityName = ANNOTATION_HELPER.getPropertyName(field);
      cp.setName(entityName);

      // settings from related complex entity
      EdmComplexType ece = field.getType().getAnnotation(EdmComplexType.class);
      String complexEntityNamespace = ece.namespace();
      if (complexEntityNamespace.isEmpty()) {
        complexEntityNamespace = defaultNamespace;
      }
      cp.setType(new FullQualifiedName(complexEntityNamespace, ece.name()));

      return cp;
    }
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.ComplexProperty

    return property;
  }

  private Property readComplexProperty(final XMLStreamReader reader, final FullQualifiedName fqName)
      throws XMLStreamException {
    ComplexProperty property = new ComplexProperty();
    property.setName(reader.getAttributeValue(null, XmlMetadataConstants.EDM_NAME));
    property.setType(fqName);
    return property;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.ComplexProperty

        properties.add(new SimpleProperty().setName("RoomId").setType(EdmSimpleTypeKind.String)
            .setMapping(new Mapping().setInternalName("getRoom.getId")));
        properties.add(new SimpleProperty().setName("TeamId").setType(EdmSimpleTypeKind.String)
            .setFacets(new Facets().setMaxLength(2))
            .setMapping(new Mapping().setInternalName("getTeam.getId")));
        properties.add(new ComplexProperty().setName("Location").setType(COMPLEX_TYPE_1)
            .setFacets(new Facets().setNullable(false)));
        properties.add(new SimpleProperty().setName("Age").setType(EdmSimpleTypeKind.Int16));
        properties.add(new SimpleProperty().setName("EntryDate").setType(EdmSimpleTypeKind.DateTime)
            .setFacets(new Facets().setNullable(true))
            .setCustomizableFeedMappings(new CustomizableFeedMappings()
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.ComplexProperty

  @Override
  public ComplexType getComplexType(final FullQualifiedName edmFQName) throws ODataException {
    if (NAMESPACE_1.equals(edmFQName.getNamespace())) {
      if (COMPLEX_TYPE_1.getName().equals(edmFQName.getName())) {
        List<Property> properties = new ArrayList<Property>();
        properties.add(new ComplexProperty().setName("City").setType(COMPLEX_TYPE_2).setFacets(
            new Facets().setNullable(false)));
        properties.add(new SimpleProperty().setName("Country").setType(EdmSimpleTypeKind.String));
        return new ComplexType().setName(COMPLEX_TYPE_1.getName()).setProperties(properties);

      } else if (COMPLEX_TYPE_2.getName().equals(edmFQName.getName())) {
View Full Code Here

Examples of org.apache.padaf.xmpbox.type.ComplexProperty

  }

  @Test
  public void testArrayList() throws Exception {
    ComplexProperty newSeq = new ComplexProperty(parent, "nsSchem",
        "seqType", ComplexProperty.ORDERED_ARRAY);
    TextType li1 = new TextType(parent, "rdf", "li", "valeur1");
    TextType li2 = new TextType(parent, "rdf", "li", "valeur2");
    newSeq.getContainer().addProperty(li1);
    newSeq.getContainer().addProperty(li2);
    schem.addProperty(newSeq);
    List<AbstractField> list = schem.getArrayList("nsSchem:seqType");
    Assert.assertTrue(list.contains(li1));
    Assert.assertTrue(list.contains(li2));
View Full Code Here

Examples of org.apache.padaf.xmpbox.type.ComplexProperty

     *            the full qualified name of property wanted
     * @param fieldValue
     *            the field value
     */
    private void removeArrayValue(String qualifiedArrayName, String fieldValue) {
        ComplexProperty array = (ComplexProperty) getAbstractProperty(qualifiedArrayName);
        if (array != null) {
            ArrayList<AbstractField> toDelete = new ArrayList<AbstractField>();
            Iterator<AbstractField> it = array.getContainer()
            .getAllProperties().iterator();
            AbstractSimpleProperty tmp;
            while (it.hasNext()) {
                tmp = (AbstractSimpleProperty) it.next();
                if (tmp.getStringValue().equals(fieldValue)) {
                    toDelete.add(tmp);
                }
            }
            Iterator<AbstractField> eraseProperties = toDelete.iterator();
            while (eraseProperties.hasNext()) {
                array.getContainer().removeProperty(eraseProperties.next());
            }
        }

    }
View Full Code Here

Examples of org.apache.padaf.xmpbox.type.ComplexProperty

     * @param bagValue
     *            The value to add to the bagList.
     */
    public void addBagValue(String qualifiedBagName, String bagValue) {
        String[] splittedQualifiedName = qualifiedBagName.split(":");
        ComplexProperty bag = (ComplexProperty) getAbstractProperty(qualifiedBagName);
        TextType li = new TextType(metadata, "rdf", "li", bagValue);
        if (bag != null) {
            bag.getContainer().addProperty(li);
        } else {
            ComplexProperty newBag = new ComplexProperty(metadata,
                    splittedQualifiedName[0], splittedQualifiedName[1],
                    ComplexProperty.UNORDERED_ARRAY);
            newBag.getContainer().addProperty(li);
            content.addProperty(newBag);
        }
    }
View Full Code Here

Examples of org.apache.padaf.xmpbox.type.ComplexProperty

     *            the full qualified name of property concerned
     * @return String list which represents content of array property
     */
    private List<String> getArrayListToString(String qualifiedArrayName) {
        List<String> retval = null;
        ComplexProperty array = (ComplexProperty) getAbstractProperty(qualifiedArrayName);
        if (array != null) {
            retval = new ArrayList<String>();
            Iterator<AbstractField> it = array.getContainer()
            .getAllProperties().iterator();
            AbstractSimpleProperty tmp;
            while (it.hasNext()) {
                tmp = (AbstractSimpleProperty) it.next();
                retval.add(tmp.getStringValue());
View Full Code Here

Examples of org.apache.padaf.xmpbox.type.ComplexProperty

     * @param fieldValue
     *            the elementable field value
     */
    public void removeArrayValue(String qualifiedArrayName,
            Elementable fieldValue) {
        ComplexProperty array = (ComplexProperty) getAbstractProperty(qualifiedArrayName);
        if (array != null) {
            ArrayList<AbstractField> toDelete = new ArrayList<AbstractField>();
            Iterator<AbstractField> it = array.getContainer()
            .getAllProperties().iterator();
            AbstractSimpleProperty tmp;
            while (it.hasNext()) {
                tmp = (AbstractSimpleProperty) it.next();
                if (tmp.equals(fieldValue)) {
                    toDelete.add(tmp);
                }
            }
            Iterator<AbstractField> eraseProperties = toDelete.iterator();
            while (eraseProperties.hasNext()) {
                array.getContainer().removeProperty(eraseProperties.next());
            }
        }
    }
View Full Code Here

Examples of org.apache.padaf.xmpbox.type.ComplexProperty

     * @param seqValue
     *            The value to add to the sequence.
     */
    public void addSequenceValue(String qualifiedSeqName, String seqValue) {
        String[] splittedQualifiedName = qualifiedSeqName.split(":");
        ComplexProperty seq = (ComplexProperty) getAbstractProperty(qualifiedSeqName);
        TextType li = new TextType(metadata, "rdf", "li", seqValue);
        if (seq != null) {
            seq.getContainer().addProperty(li);
        } else {
            ComplexProperty newSeq = new ComplexProperty(metadata,
                    splittedQualifiedName[0], splittedQualifiedName[1],
                    ComplexProperty.ORDERED_ARRAY);
            newSeq.getContainer().addProperty(li);
            content.addProperty(newSeq);
        }

    }
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.