Package org.platformlayer.xml.XmlHelper

Examples of org.platformlayer.xml.XmlHelper.ElementInfo


import com.google.common.base.Objects;

public abstract class TypedItemMapper {

  public <T> T promoteToTyped(UntypedItem untypedItem) throws OpsException {
    ElementInfo elementInfo = ((UntypedItemXml) untypedItem).getRootElementInfo();

    Class<T> javaClass = mapToJavaClass(elementInfo);

    return promoteToTyped(untypedItem, javaClass);
  }
View Full Code Here


  }

  public void visit(UntypedItem item) throws PlatformLayerClientException {
    UntypedItemXml untypedItem = (UntypedItemXml) item;

    ElementInfo rootElementInfo = untypedItem.getRootElementInfo();

    boolean consider = true;

    switch (untypedItem.getState()) {
    case DELETED:
View Full Code Here

  @Override
  public <T extends ItemBase> ModelClass<T> getModelClass(Class<T> itemClass) {
    ModelClass<T> modelClass = javaClassToModelClass.get(itemClass);
    if (modelClass == null) {
      // Fallback to matching on XML info
      ElementInfo elementInfo = XmlHelper.getXmlElementInfo(itemClass);

      if (elementInfo != null) {
        ServiceProvider serviceProvider = serviceProvidersByNamespace.get(elementInfo.namespace);
        if (serviceProvider != null) {
          ItemType itemType = new ItemType(elementInfo.elementName);
View Full Code Here

      if (Strings.isNullOrEmpty(namespace)) {
        namespace = null;
      }
    }

    return new ElementInfo(namespace, name);

  }
View Full Code Here

  }

  @Override
  protected <T> Class<T> mapToJavaClass(ElementInfo elementInfo) throws OpsException {
    for (Class<?> modelClass : modelClasses) {
      ElementInfo classElementInfo = XmlHelper.getXmlElementInfo(modelClass);
      if (elementInfo.equals(classElementInfo)) {
        return (Class<T>) modelClass;
      }
    }
View Full Code Here

TOP

Related Classes of org.platformlayer.xml.XmlHelper.ElementInfo

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.