Package com.woorea.openstack.keystone.v3.model

Examples of com.woorea.openstack.keystone.v3.model.Group


        StructureDefinition retVal = new StructureDefinition();
        retVal.setName(theStructure.getName());

        if (theStructure instanceof Group) {
            retVal.setSegment(false);
            Group group = (Group) theStructure;
            int index = 0;
            for (String nextName : group.getNames()) {
                Structure nextChild = group.get(nextName);
                StructureDefinition structureDefinition = createStructureDefinition(nextChild, thePreviousLeaf);
                structureDefinition.setNameAsItAppearsInParent(nextName);
                structureDefinition.setRepeating(group.isRepeating(nextName));
                structureDefinition.setRequired(group.isRequired(nextName));
                structureDefinition.setPosition(index++);
                structureDefinition.setParent(retVal);
                retVal.addChild(structureDefinition);
            }
        } else {
View Full Code Here


    StructureDefinition retVal = new StructureDefinition();
    retVal.setName(theStructure.getName());

    if (theStructure instanceof Group) {
      retVal.setSegment(false);
      Group group = (Group) theStructure;
      int index = 0;
      List<String> childNames = Arrays.asList(group.getNames());
     
      /*
       * For SuperStructures, which can hold more than one type of structure,
       * we only actually bring in the child names that are actually a part
       * of the structure we are trying to parse
       */
      if (theStructure instanceof SuperStructure) {
        String struct = theStructureName;
        Map<String, String> evtMap = new DefaultModelClassFactory().getEventMapForVersion(Version.versionOf(theStructure.getMessage().getVersion()));
        if (evtMap.containsKey(struct)) {
          struct = evtMap.get(struct);
        }
        childNames = ((SuperStructure) theStructure).getChildNamesForStructure(struct);
      }
     
      for (String nextName : childNames) {
        Structure nextChild = group.get(nextName);
        StructureDefinition structureDefinition = createStructureDefinition(nextChild, thePreviousLeaf, theStructureName);
        structureDefinition.setNameAsItAppearsInParent(nextName);
        structureDefinition.setRepeating(group.isRepeating(nextName));
        structureDefinition.setRequired(group.isRequired(nextName));
        structureDefinition.setChoiceElement(group.isChoiceElement(nextName));
        structureDefinition.setPosition(index++);
        structureDefinition.setParent(retVal);
        retVal.addChild(structureDefinition);
      }
    } else {
View Full Code Here

        StructureDefinition retVal = new StructureDefinition();
        retVal.setName(theStructure.getName());

        if (theStructure instanceof Group) {
            retVal.setSegment(false);
            Group group = (Group) theStructure;
            int index = 0;
            for (String nextName : group.getNames()) {
                Structure nextChild = group.get(nextName);
                StructureDefinition structureDefinition = createStructureDefinition(nextChild, thePreviousLeaf);
                structureDefinition.setNameAsItAppearsInParent(nextName);
                structureDefinition.setRepeating(group.isRepeating(nextName));
                structureDefinition.setRequired(group.isRequired(nextName));
                structureDefinition.setPosition(index++);
                structureDefinition.setParent(retVal);
                retVal.addChild(structureDefinition);
            }
        } else {
View Full Code Here

    private void addNonStandardSegmentAtCurrentPosition() throws Error {
      log.debug("Creating non standard segment {} on group: {}",
          myDirection, getCurrentPosition().getStructureDefinition().getParent().getName());
        List<Position> parentDefinitionPath = new ArrayList<Position>(myCurrentDefinitionPath.subList(0, myCurrentDefinitionPath.size() - 1));
        Group parentStructure = (Group) navigateToStructure(parentDefinitionPath);

        // Current position within parent
        Position currentPosition = getCurrentPosition();
    String nameAsItAppearsInParent = currentPosition.getStructureDefinition().getNameAsItAppearsInParent();

    int index = Arrays.asList(parentStructure.getNames()).indexOf(nameAsItAppearsInParent) + 1;
   
        String newSegmentName;
   
    // Check if the structure already has a non-standard segment in the appropriate
    // position
    String[] currentNames = parentStructure.getNames();
    if (index < currentNames.length && currentNames[index].startsWith(myDirection)) {
      newSegmentName = currentNames[index];
    } else {
          try {
              newSegmentName = parentStructure.addNonstandardSegment(myDirection, index);
          } catch (HL7Exception e) {
              throw new Error("Unable to add nonstandard segment " + myDirection + ": ", e);
          }
      }
   
View Full Code Here

            if (currentStructure == null) {
                currentStructure = myMessage;
            } else {
                try {
                    IStructureDefinition structureDefinition = next.getStructureDefinition();
                    Group currentStructureGroup = (Group) currentStructure;
                    String nextStructureName = structureDefinition.getNameAsItAppearsInParent();
                    currentStructure = currentStructureGroup.get(nextStructureName, next.getRepNumber());
                } catch (HL7Exception e) {
                    throw new Error("Failed to retrieve structure: ", e);
                }
            }
        }
View Full Code Here

        StructureDefinition retVal = new StructureDefinition();
        retVal.setName(theStructure.getName());

        if (theStructure instanceof Group) {
            retVal.setSegment(false);
            Group group = (Group) theStructure;
            int index = 0;
            for (String nextName : group.getNames()) {
                Structure nextChild = group.get(nextName);
                StructureDefinition structureDefinition = createStructureDefinition(nextChild, thePreviousLeaf);
                structureDefinition.setNameAsItAppearsInParent(nextName);
                structureDefinition.setRepeating(group.isRepeating(nextName));
                structureDefinition.setRequired(group.isRequired(nextName));
                structureDefinition.setPosition(index++);
                structureDefinition.setParent(retVal);
                retVal.addChild(structureDefinition);
            }
        } else {
View Full Code Here

        StructureDefinition retVal = new StructureDefinition();
        retVal.setName(theStructure.getName());

        if (theStructure instanceof Group) {
            retVal.setSegment(false);
            Group group = (Group) theStructure;
            int index = 0;
            for (String nextName : group.getNames()) {
                Structure nextChild = group.get(nextName);
                StructureDefinition structureDefinition = createStructureDefinition(nextChild, thePreviousLeaf);
                structureDefinition.setNameAsItAppearsInParent(nextName);
                structureDefinition.setRepeating(group.isRepeating(nextName));
                structureDefinition.setRequired(group.isRequired(nextName));
                structureDefinition.setPosition(index++);
                structureDefinition.setParent(retVal);
                retVal.addChild(structureDefinition);
            }
        } else {
View Full Code Here

    private void addNonStandardSegmentAtCurrentPosition() throws Error {
        if (log.isDebugEnabled()) {
            log.debug("Creating non standard segment " + myDirection + " on group: " + getCurrentPosition().getStructureDefinition().getParent().getName());
        }
        List<Position> parentDefinitionPath = new ArrayList<Position>(myCurrentDefinitionPath.subList(0, myCurrentDefinitionPath.size() - 1));
        Group parentStructure = (Group) navigateToStructure(parentDefinitionPath);

        // Current position within parent
        Position currentPosition = getCurrentPosition();
    String nameAsItAppearsInParent = currentPosition.getStructureDefinition().getNameAsItAppearsInParent();

    int index = Arrays.asList(parentStructure.getNames()).indexOf(nameAsItAppearsInParent) + 1;
   
        String newSegmentName;
        try {
            newSegmentName = parentStructure.addNonstandardSegment(myDirection, index);
        } catch (HL7Exception e) {
            throw new Error("Unable to add nonstandard segment " + myDirection + ": ", e);
        }
        IStructureDefinition previousSibling = getCurrentPosition().getStructureDefinition();
        IStructureDefinition parentStructureDefinition = parentDefinitionPath.get(parentDefinitionPath.size() - 1).getStructureDefinition();
View Full Code Here

            if (currentStructure == null) {
                currentStructure = myMessage;
            } else {
                try {
                    IStructureDefinition structureDefinition = next.getStructureDefinition();
                    Group currentStructureGroup = (Group) currentStructure;
                    String nextStructureName = structureDefinition.getNameAsItAppearsInParent();
                    currentStructure = currentStructureGroup.get(nextStructureName, next.getRepNumber());
                } catch (HL7Exception e) {
                    throw new Error("Failed to retrieve structure: ", e);
                }
            }
        }
View Full Code Here

    StructureDefinition retVal = new StructureDefinition();
    retVal.setName(theStructure.getName());

    if (theStructure instanceof Group) {
      retVal.setSegment(false);
      Group group = (Group) theStructure;
      int index = 0;
      List<String> childNames = Arrays.asList(group.getNames());
     
      /*
       * For SuperStructures, which can hold more than one type of structure,
       * we only actually bring in the child names that are actually a part
       * of the structure we are trying to parse
       */
      if (theStructure instanceof SuperStructure) {
        String struct = theStructureName;
        Map<String, String> evtMap = new DefaultModelClassFactory().getEventMapForVersion(Version.versionOf(theStructure.getMessage().getVersion()));
        if (evtMap.containsKey(struct)) {
          struct = evtMap.get(struct);
        }
        childNames = ((SuperStructure) theStructure).getChildNamesForStructure(struct);
      }
     
      for (String nextName : childNames) {
        Structure nextChild = group.get(nextName);
        StructureDefinition structureDefinition = createStructureDefinition(nextChild, thePreviousLeaf, theStructureName);
        structureDefinition.setNameAsItAppearsInParent(nextName);
        structureDefinition.setRepeating(group.isRepeating(nextName));
        structureDefinition.setRequired(group.isRequired(nextName));
        structureDefinition.setChoiceElement(group.isChoiceElement(nextName));
        structureDefinition.setPosition(index++);
        structureDefinition.setParent(retVal);
        retVal.addChild(structureDefinition);
      }
    } else {
View Full Code Here

TOP

Related Classes of com.woorea.openstack.keystone.v3.model.Group

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.