Package gov.nist.scap.xccdf.document

Examples of gov.nist.scap.xccdf.document.DefaultLiteralValue


  protected boolean handleItem(Item item) throws PropertyNotFoundException {
    boolean handled = false;
    if (item instanceof Value) {
      handled = true;
      Value value = (Value) item;
      value.setLiteralValue(new DefaultLiteralValue(null, this.value, false));
    }
    return handled;
  }
View Full Code Here


  protected boolean handleItem(Item item) throws PropertyNotFoundException {
    boolean handled = false;
    if (item instanceof Value) {
      handled = true;
      Value value = (Value) item;
      value.setLiteralValue(new DefaultLiteralValue(null, this.values, true));
//      value.setValue(getValues());
    }
    return handled;
  }
View Full Code Here

      do {
        LiteralValue literal;
        XmlObject obj = cursor.getObject();
        if (obj instanceof SelStringType) {
          SelStringType node = (SelStringType)obj;
          literal = new DefaultLiteralValue(
              node.getSelector(),
              Collections.singletonList(node.getStringValue()),
              false);
          found = true;
        } else if (obj instanceof SelComplexValueType) {
          SelComplexValueType node = (SelComplexValueType)obj;
          literal = new DefaultLiteralValue(
              node.getSelector(),
              node.getItemList(),
              true);
          found = true;
        } else {
          if (!found) {
            continue;
          }
          // Not a valid (literal) value instance
          break;
        }
        addLiteralValue(literal);
      } while (cursor.toNextSibling());

      // Check if there is a null selector entry which will correspond to
      // the default entry.  If not present, elect the first entry to be
      // the default with a null selector.
      Map<String, LiteralValue> selectorToLiteralValueMap = getSelectorToLiteralValueMap();
      if (!selectorToLiteralValueMap.containsKey(null)) {
        LiteralValue firstLiteral = selectorToLiteralValueMap.values().iterator().next();
        LiteralValue defaultLiteral = new DefaultLiteralValue(null, firstLiteral.getValues(), firstLiteral.isComplex());
        addLiteralValue(defaultLiteral);
      }
    } else {
      throw new IllegalStateException(new PropertyNotFoundException("value '" + getId()
          + "'is missing a default value property"));
View Full Code Here

      do {
        LiteralValue literal;
        XmlObject obj = cursor.getObject();
        if (obj instanceof SelStringType) {
          SelStringType node = (SelStringType)obj;
          literal = new DefaultLiteralValue(
              node.getSelector(),
              Collections.singletonList(node.getStringValue()),
              false);
          found = true;
        } else {
          if (!found) {
            continue;
          }
          // Not a valid (literal) value instance
          break;
        }
        addLiteralValue(literal);
      } while (cursor.toNextSibling());

      // Check if there is a null selector entry which will correspond to
      // the default entry.  If not present, elect the first entry to be
      // the default with a null selector.
      Map<String, LiteralValue> selectorToLiteralValueMap = getSelectorToLiteralValueMap();
      if (!selectorToLiteralValueMap.containsKey(null)) {
        LiteralValue firstLiteral = selectorToLiteralValueMap.values().iterator().next();
        LiteralValue defaultLiteral = new DefaultLiteralValue(null, firstLiteral.getValues(), firstLiteral.isComplex());
        addLiteralValue(defaultLiteral);
      }
    } else {
      throw new IllegalStateException(new PropertyNotFoundException("value '" + getId()
          + "'is missing a default value property"));
View Full Code Here

TOP

Related Classes of gov.nist.scap.xccdf.document.DefaultLiteralValue

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.