Examples of LiteralValue


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

    // The schema requires that at least one value be provided
    if (cursor.toFirstChild()) {
      boolean found = false;
      // Build a map of elements using the selector as the key
      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

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

    // The schema requires that at least one value be provided
    if (cursor.toFirstChild()) {
      boolean found = false;
      // Build a map of elements using the selector as the key
      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

Examples of net.sourceforge.javautil.bytecode.api.LiteralValue

    super(rootComponentType);
    this.values = values;
  }

  public void load(BytecodeContextMethod context) {
    context.getWriter().newArray(context, descriptor, new LiteralValue(values.length));
   
    for (int idx=0; idx<values.length; idx++) {
      context.getWriter().dup(context);
      new LiteralValue(idx).load(context);
      context.coerce(descriptor, values[idx]);
     
      context.getWriter().arrayStore(context);
    }
  }
View Full Code Here

Examples of net.sourceforge.javautil.bytecode.api.LiteralValue

   
    for (int i=0; i<arguments.length; i++) {
      if (arguments[i] instanceof IBytecodeReferenceable) {
        translated[i] = (IBytecodeReferenceable) arguments[i];
      } else {
        translated[i] = new LiteralValue(arguments[i]);
      }
    }
   
    return translated;
  }
View Full Code Here

Examples of net.sourceforge.javautil.bytecode.api.LiteralValue

   
    context.returnValue( context.getThisField("interceptor").createInvocation(context, "invoke",
      context.getThisField(InterceptorProxyTypeCJCW.TARGET_FIELD_NAME).createInvocation(context, "get", context.resolve("this")),
      context.createInvocation(helper, "findMethod",
        context.createInvocation(context.resolve("this"), "getClass").createInvocation(context, "getSuperclass"),
        new LiteralValue(context.getMethod().getName()),
        context.getThisField("cache"),
        new LiteralValue(context.getMethod().getDescriptor().toDescriptorString())
      ),
      context.initializeArray(context.resolve(Object.class), context.getMethodArguments())
    ));
  }
View Full Code Here

Examples of net.sourceforge.javautil.bytecode.api.LiteralValue

    IBytecodeResolvable helper = context.resolve(InterceptorHelper.class);
   
    context.returnValue( context.getThisField("interceptor").createInvocation(context, "invoke", context.resolve("this"),
      context.createInvocation(helper, "findMethod",
        context.createInvocation(context.resolve("this"), "getClass"),
        new LiteralValue(context.getMethod().getName() + "$$"),
        context.getThisField("cache"),
        new LiteralValue(context.getMethod().getDescriptor().toDescriptorString())
      ),
      context.initializeArray(context.resolve(Object.class), context.getMethodArguments())
    ));
  }
View Full Code Here

Examples of org.apache.tajo.algebra.LiteralValue

    CreateTable.ListPartition listPartition = createTable.getPartitionMethod();
    assertEquals("col1", listPartition.getColumns()[0].getCanonicalName());
    assertEquals(2, listPartition.getSpecifiers().size());
    Iterator<CreateTable.ListPartitionSpecifier> iterator = listPartition.getSpecifiers().iterator();
    CreateTable.ListPartitionSpecifier specifier = iterator.next();
    LiteralValue value1 = (LiteralValue) specifier.getValueList().getValues()[0];
    LiteralValue value2 = (LiteralValue) specifier.getValueList().getValues()[1];
    assertEquals("Seoul", value1.getValue());
    assertEquals("서울", value2.getValue());

    specifier = iterator.next();
    value1 = (LiteralValue) specifier.getValueList().getValues()[0];
    value2 = (LiteralValue) specifier.getValueList().getValues()[1];
    assertEquals("Busan", value1.getValue());
    assertEquals("부산", value2.getValue());
  }
View Full Code Here

Examples of org.crsh.cli.impl.LiteralValue

  }

  private List<LiteralValue> bilto(List<? extends Token.Literal> literals) {
    List<LiteralValue> values = new ArrayList<LiteralValue>(literals.size());
    for (Token.Literal literal : literals) {
      values.add(new LiteralValue(literal.getRaw(), literal.getValue()));
    }
    return values;
  }
View Full Code Here

Examples of org.exist.xquery.LiteralValue

    }

    protected AnnotationAdapter(final org.exist.xquery.Annotation annotation, final FunctionSignatureAdapter functionSignatureAdapter) {
        this.name = annotation.getName().toJavaQName();
       
        final LiteralValue literalValues[] = annotation.getValue();
        this.literals = new LiteralValueAdapter[literalValues.length];
        for(int i = 0; i < literalValues.length; i++) {
            literals[i] = new LiteralValueAdapter(literalValues[i]);
        }
       
View Full Code Here

Examples of org.exist.xquery.LiteralValue

         
        final UserDefinedFunction function = context.resolveFunction(functionName, urls.length);
        if (function != null) {
          final List<Expression> args = new ArrayList<Expression>(urls.length);
          for (int i = 0; i < urls.length; i++)
            args.add(new LiteralValue(context, new AnyURIValue(urls[i])));
         
          pm = broker.getBrokerPool().getProcessMonitor();
         
              context.getProfiler().traceQueryStart();
              pm.queryStarted(context.getWatchDog());
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.