Examples of CommonAttributesImpl


Examples of org.apache.olingo.odata2.core.servicedocument.CommonAttributesImpl

  public ServiceDocumentImpl readServiceDokument(final XMLStreamReader reader) throws EntityProviderException {
    AtomInfoImpl atomInfo = new AtomInfoImpl();
    ServiceDocumentImpl serviceDocument = new ServiceDocumentImpl();
    List<Workspace> workspaces = new ArrayList<Workspace>();
    List<ExtensionElement> extElements = new ArrayList<ExtensionElement>();
    CommonAttributesImpl attributes = new CommonAttributesImpl();
    try {
      while (reader.hasNext()
          && !(reader.isEndElement() && Edm.NAMESPACE_APP_2007.equals(reader.getNamespaceURI()) && FormatXml.APP_SERVICE
              .equals(reader.getLocalName()))) {
        reader.next();
View Full Code Here

Examples of org.apache.olingo.odata2.core.servicedocument.CommonAttributesImpl

          .getSimpleName()), e);
    }
  }

  private CommonAttributesImpl parseCommonAttribute(final XMLStreamReader reader) {
    CommonAttributesImpl attribute = new CommonAttributesImpl();
    List<ExtensionAttribute> extAttributes = new ArrayList<ExtensionAttribute>();
    attribute.setBase(reader.getAttributeValue(null, FormatXml.XML_BASE));
    attribute.setLang(reader.getAttributeValue(null, FormatXml.XML_LANG));
    for (int i = 0; i < reader.getAttributeCount(); i++) {
      if (!(FormatXml.XML_BASE.equals(reader.getAttributeLocalName(i))
          && Edm.PREFIX_XML.equals(reader.getAttributePrefix(i))
          || (FormatXml.XML_LANG.equals(reader.getAttributeLocalName(i)) && Edm.PREFIX_XML.equals(reader
              .getAttributePrefix(i)))
          || ("local".equals(reader.getAttributeNamespace(i)) || DEFAULT_PREFIX.equals(reader.getAttributePrefix(i)))))
      {
        extAttributes.add(new ExtensionAttributeImpl()
            .setName(reader.getAttributeLocalName(i))
            .setNamespace(reader.getAttributeNamespace(i))
            .setPrefix(reader.getAttributePrefix(i))
            .setText(reader.getAttributeValue(i)));
      }
    }

    return attribute.setAttributes(extAttributes);
  }
View Full Code Here

Examples of org.apache.olingo.odata2.core.servicedocument.CommonAttributesImpl

    reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_APP_2007, FormatXml.APP_WORKSPACE);

    TitleImpl title = null;
    List<Collection> collections = new ArrayList<Collection>();
    List<ExtensionElement> extElements = new ArrayList<ExtensionElement>();
    CommonAttributesImpl attributes = parseCommonAttribute(reader);
    while (reader.hasNext()
        && !(reader.isEndElement() && Edm.NAMESPACE_APP_2007.equals(reader.getNamespaceURI()) && FormatXml.APP_WORKSPACE
            .equals(reader.getLocalName()))) {
      reader.next();
      if (reader.isStartElement()) {
View Full Code Here

Examples of org.apache.olingo.odata2.core.servicedocument.CommonAttributesImpl

  private CollectionImpl parseCollection(final XMLStreamReader reader) throws XMLStreamException,
      EntityProviderException {
    reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_APP_2007, FormatXml.APP_COLLECTION);
    TitleImpl title = null;
    String resourceIdentifier = reader.getAttributeValue(null, FormatXml.ATOM_HREF);
    CommonAttributesImpl attributes = parseCommonAttribute(reader);
    List<ExtensionElement> extElements = new ArrayList<ExtensionElement>();
    List<Accept> acceptList = new ArrayList<Accept>();
    List<Categories> categories = new ArrayList<Categories>();
    if (resourceIdentifier == null) {
      throw new EntityProviderException(EntityProviderException.MISSING_ATTRIBUTE.addContent("href"));
View Full Code Here

Examples of org.apache.olingo.odata2.core.servicedocument.CommonAttributesImpl

    return new TitleImpl().setText(text);
  }

  private AcceptImpl parseAccept(final XMLStreamReader reader) throws XMLStreamException {
    reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_APP_2007, FormatXml.APP_ACCEPT);
    CommonAttributesImpl commonAttributes = parseCommonAttribute(reader);
    String text = reader.getElementText();
    reader.require(XMLStreamConstants.END_ELEMENT, Edm.NAMESPACE_APP_2007, FormatXml.APP_ACCEPT);
    return new AcceptImpl().setCommonAttributes(commonAttributes).setText(text);
  }
View Full Code Here

Examples of org.apache.olingo.odata2.core.servicedocument.CommonAttributesImpl

    reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_ATOM_2005, FormatXml.ATOM_CATEGORY);
    CategoryImpl category = new CategoryImpl();
    category.setScheme(reader.getAttributeValue(null, FormatXml.ATOM_CATEGORY_SCHEME));
    category.setTerm(reader.getAttributeValue(null, FormatXml.ATOM_CATEGORY_TERM));
    category.setLabel(reader.getAttributeValue(null, FormatXml.ATOM_CATEGORY_LABEL));
    CommonAttributesImpl attributes = parseCommonAttribute(reader);
    return category.setCommonAttributes(attributes);
  }
View Full Code Here

Examples of org.apache.olingo.odata2.core.servicedocument.CommonAttributesImpl

  public ServiceDocumentImpl readServiceDokument(final XMLStreamReader reader) throws EntityProviderException {
    AtomInfoImpl atomInfo = new AtomInfoImpl();
    ServiceDocumentImpl serviceDocument = new ServiceDocumentImpl();
    List<Workspace> workspaces = new ArrayList<Workspace>();
    List<ExtensionElement> extElements = new ArrayList<ExtensionElement>();
    CommonAttributesImpl attributes = new CommonAttributesImpl();
    try {
      while (reader.hasNext()
          && !(reader.isEndElement() && Edm.NAMESPACE_APP_2007.equals(reader.getNamespaceURI()) && FormatXml.APP_SERVICE
              .equals(reader.getLocalName()))) {
        reader.next();
View Full Code Here

Examples of org.apache.olingo.odata2.core.servicedocument.CommonAttributesImpl

          .getSimpleName()), e);
    }
  }

  private CommonAttributesImpl parseCommonAttribute(final XMLStreamReader reader) {
    CommonAttributesImpl attribute = new CommonAttributesImpl();
    List<ExtensionAttribute> extAttributes = new ArrayList<ExtensionAttribute>();
    attribute.setBase(reader.getAttributeValue(null, FormatXml.XML_BASE));
    attribute.setLang(reader.getAttributeValue(null, FormatXml.XML_LANG));
    for (int i = 0; i < reader.getAttributeCount(); i++) {
      if (!(FormatXml.XML_BASE.equals(reader.getAttributeLocalName(i))
          && Edm.PREFIX_XML.equals(reader.getAttributePrefix(i))
          || (FormatXml.XML_LANG.equals(reader.getAttributeLocalName(i)) && Edm.PREFIX_XML.equals(reader
              .getAttributePrefix(i)))
          || ("local".equals(reader.getAttributeNamespace(i)) || DEFAULT_PREFIX.equals(reader.getAttributePrefix(i)))))
      {
        extAttributes.add(new ExtensionAttributeImpl()
            .setName(reader.getAttributeLocalName(i))
            .setNamespace(reader.getAttributeNamespace(i))
            .setPrefix(reader.getAttributePrefix(i))
            .setText(reader.getAttributeValue(i)));
      }
    }

    return attribute.setAttributes(extAttributes);
  }
View Full Code Here

Examples of org.apache.olingo.odata2.core.servicedocument.CommonAttributesImpl

    reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_APP_2007, FormatXml.APP_WORKSPACE);

    TitleImpl title = null;
    List<Collection> collections = new ArrayList<Collection>();
    List<ExtensionElement> extElements = new ArrayList<ExtensionElement>();
    CommonAttributesImpl attributes = parseCommonAttribute(reader);
    while (reader.hasNext()
        && !(reader.isEndElement() && Edm.NAMESPACE_APP_2007.equals(reader.getNamespaceURI()) && FormatXml.APP_WORKSPACE
            .equals(reader.getLocalName()))) {
      reader.next();
      if (reader.isStartElement()) {
View Full Code Here

Examples of org.apache.olingo.odata2.core.servicedocument.CommonAttributesImpl

  private CollectionImpl parseCollection(final XMLStreamReader reader) throws XMLStreamException,
      EntityProviderException {
    reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_APP_2007, FormatXml.APP_COLLECTION);
    TitleImpl title = null;
    String resourceIdentifier = reader.getAttributeValue(null, FormatXml.ATOM_HREF);
    CommonAttributesImpl attributes = parseCommonAttribute(reader);
    List<ExtensionElement> extElements = new ArrayList<ExtensionElement>();
    List<Accept> acceptList = new ArrayList<Accept>();
    List<Categories> categories = new ArrayList<Categories>();
    if (resourceIdentifier == null) {
      throw new EntityProviderException(EntityProviderException.MISSING_ATTRIBUTE.addContent("href"));
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.