Package com.thoughtworks.xstream.io.path

Examples of com.thoughtworks.xstream.io.path.Path


      } else if (!(item instanceof IdentifiableDiagramElement)) {
        // we're only going to allow references on non-identifiable
        // diagram elements
        converter.marshal(item, writer, this);
      } else {
        Path currentPath = pathTracker.getPath();
        Object existingReferenceKey = references.lookupId(item);
        if (existingReferenceKey != null) {
          writer.addAttribute(getMapper().aliasForAttribute("reference"), createReference(currentPath,
              existingReferenceKey));
        } else if (implicitElements.lookupId(item) != null) {
          throw new ReferencedImplicitElementException(item, currentPath);
        } else {
          String newReferenceKey = null;
          boolean fire = false;
          if (item instanceof IdentifiableDiagramElement) {
            newReferenceKey = ensureUniqueness((IdentifiableDiagramElement) item);
          } else {
            newReferenceKey = makeUnique("" + nextIntId++);
            fire = true;
          }

          if (lastPath == null || !currentPath.isAncestor(lastPath)) {
            if (fire) {
              fireValidReference(newReferenceKey);
            }
            lastPath = currentPath;
            if (usedIDs.contains(newReferenceKey)) {
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.io.path.Path

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.