Examples of AtomInfoImpl


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

public class AtomServiceDocumentConsumer {
  private String currentHandledStartTagName;
  private static final String DEFAULT_PREFIX = "";

  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();
        if (reader.isStartElement()) {
          currentHandledStartTagName = reader.getLocalName();
          if (FormatXml.APP_SERVICE.equals(currentHandledStartTagName)) {
            attributes = parseCommonAttribute(reader);
          } else if (FormatXml.APP_WORKSPACE.equals(currentHandledStartTagName)) {
            workspaces.add(parseWorkspace(reader));
          } else {
            ExtensionElementImpl extElement = parseExtensionElement(reader);
            if (extElement != null) {
              extElements.add(extElement);
            }
          }
        }
      }
      if (workspaces.isEmpty()) {
        throw new EntityProviderException(EntityProviderException.INVALID_STATE
            .addContent("Service element must contain at least one workspace element"));
      }
      reader.close();
      atomInfo.setWorkspaces(workspaces).setCommonAttributes(attributes).setExtesionElements(extElements);

      serviceDocument.setAtomInfo(atomInfo);
      serviceDocument.setEntitySetsInfo(atomInfo.getEntitySetsInfo());
      return serviceDocument;
    } catch (XMLStreamException e) {
      throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass()
          .getSimpleName()), e);
    }
View Full Code Here

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

public class AtomServiceDocumentConsumer {
  private String currentHandledStartTagName;
  private static final String DEFAULT_PREFIX = "";

  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();
        if (reader.isStartElement()) {
          currentHandledStartTagName = reader.getLocalName();
          if (FormatXml.APP_SERVICE.equals(currentHandledStartTagName)) {
            attributes = parseCommonAttribute(reader);
          } else if (FormatXml.APP_WORKSPACE.equals(currentHandledStartTagName)) {
            workspaces.add(parseWorkspace(reader));
          } else {
            ExtensionElementImpl extElement = parseExtensionElement(reader);
            if (extElement != null) {
              extElements.add(extElement);
            }
          }
        }
      }
      if (workspaces.isEmpty()) {
        throw new EntityProviderException(EntityProviderException.INVALID_STATE
            .addContent("Service element must contain at least one workspace element"));
      }
      reader.close();
      atomInfo.setWorkspaces(workspaces).setCommonAttributes(attributes).setExtesionElements(extElements);

      serviceDocument.setAtomInfo(atomInfo);
      serviceDocument.setEntitySetsInfo(atomInfo.getEntitySetsInfo());
      return serviceDocument;
    } catch (XMLStreamException e) {
      throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass()
          .getSimpleName()), e);
    }
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.