Examples of Code


Examples of ch.ethz.inf.vs.californium.coap.CoAP.Code

   *
   * @param exchange the exchange with the request
   */
  @Override
  public void handleRequest(final Exchange exchange) {
    Code code = exchange.getRequest().getCode();
    switch (code) {
      case GET:  handleGET(new CoapExchange(exchange, this)); break;
      case POST:  handlePOST(new CoapExchange(exchange, this)); break;
      case PUT:  handlePUT(new CoapExchange(exchange, this)); break;
      case DELETE: handleDELETE(new CoapExchange(exchange, this)); break;
View Full Code Here

Examples of ch.grengine.code.Code

        staticTopLoader = builder.getParent();
        List<Sources> sourcesLayers = builder.getSourcesLayers();
        codeLayers = new LinkedList<Code>();
        for (Sources sources : sourcesLayers) {
            CompilerFactory compilerFactory = sources.getCompilerFactory();
            Code code = compilerFactory.newCompiler(staticTopLoader).compile(sources);
            codeLayers.add(code);
            staticTopLoader = new BytecodeClassLoader(staticTopLoader, builder.getLoadMode(), code);
        }
        // set code layers in builder so that the builder
        // can be reused without recompiling (e.g. for clone())
View Full Code Here

Examples of com.android.dex.Code

        initMethodTypes();
        return;
      }

      DexNode dex = parentClass.dex();
      Code mthCode = dex.readCode(methodData);
      regsCount = mthCode.getRegistersSize();
      initMethodTypes();

      InsnDecoder decoder = new InsnDecoder(this);
      decoder.decodeInsns(mthCode);
      instructions = decoder.process();
      codeSize = instructions.length;

      initTryCatches(mthCode);
      initJumps();

      this.debugInfoOffset = mthCode.getDebugInfoOffset();
    } catch (Exception e) {
      if (!noCode) {
        noCode = true;
        // load without code
        load();
View Full Code Here

Examples of com.cardence.lawshelf.model.Code

      Section parent = new Section();
      parent.setId(rs.getInt("parent_section_id"));
      section.setParentSectionId(parent.getId());
      section.setParent(parent);

      Code code = new Code();
      code.setId(rs.getInt("code_id"));
      section.setCode(code);
      section.setCodeId(code.getId());

      section.setId(rs.getInt("id"));
      section.setSourceReference(rs.getString("source_reference"));
      section.setSectionSequence(rs.getInt("section_sequence"));
      section.setShortHeading(rs.getString("short_heading"));
View Full Code Here

Examples of com.cardence.lawshelf.model.xml.Code

      SchemaFactory schemaFactory = SchemaFactory
          .newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
      Schema schema = schemaFactory.newSchema(xsdFile);
      unmarshaller.setSchema(schema);

      Code code = (Code) unmarshaller.unmarshal(f);
      Assert.notNull(code, "Could not convert xml to code");

      handler.convertXmlToMySql(code);
    } catch (SAXException e) {
      e.printStackTrace();
View Full Code Here

Examples of com.dianping.cat.configuration.app.entity.Code

        title = platform.getName();
      }
      break;
    case CODE:
      Map<Integer, Code> codes = m_manager.queryCodeByCommand(command);
      Code code = null;
      keyValue = data.getCode();

      if (codes != null && (code = codes.get(keyValue)) != null) {
        title = code.getName();
      }
      break;
    default:
      throw new RuntimeException("Unrecognized groupby field: " + field);
    }
View Full Code Here

Examples of com.google.dexmaker.Code

            }
            Class<?> returnType = method.getReturnType();
            TypeId<?> resultType = TypeId.get(returnType);
            MethodId<T, ?> superMethod = superclassType.getMethod(resultType, name, argTypes);
            MethodId<?, ?> methodId = generatedType.getMethod(resultType, name, argTypes);
            Code code = dexMaker.declare(methodId, PUBLIC);
            Local<G> localThis = code.getThis(generatedType);
            Local<InvocationHandler> localHandler = code.newLocal(handlerType);
            Local<Object> invokeResult = code.newLocal(TypeId.OBJECT);
            Local<Integer> intValue = code.newLocal(TypeId.INT);
            Local<Object[]> args = code.newLocal(objectArrayType);
            Local<Integer> argsLength = code.newLocal(TypeId.INT);
            Local<Object> temp = code.newLocal(TypeId.OBJECT);
            Local<?> resultHolder = code.newLocal(resultType);
            Local<Method[]> methodArray = code.newLocal(methodArrayType);
            Local<Method> thisMethod = code.newLocal(methodType);
            Local<Integer> methodIndex = code.newLocal(TypeId.INT);
            Class<?> aBoxedClass = PRIMITIVE_TO_BOXED.get(returnType);
            Local<?> aBoxedResult = null;
            if (aBoxedClass != null) {
                aBoxedResult = code.newLocal(TypeId.get(aBoxedClass));
            }
            Local<?>[] superArgs2 = new Local<?>[argClasses.length];
            Local<?> superResult2 = code.newLocal(resultType);
            Local<InvocationHandler> nullHandler = code.newLocal(handlerType);

            code.loadConstant(methodIndex, m);
            code.sget(allMethods, methodArray);
            code.aget(thisMethod, methodArray, methodIndex);
            code.loadConstant(argsLength, argTypes.length);
            code.newArray(args, argsLength);
            code.iget(handlerField, localHandler, localThis);

            // if (proxy == null)
            code.loadConstant(nullHandler, null);
            Label handlerNullCase = new Label();
            code.compare(Comparison.EQ, handlerNullCase, nullHandler, localHandler);

            // This code is what we execute when we have a valid proxy: delegate to invocation
            // handler.
            for (int p = 0; p < argTypes.length; ++p) {
                code.loadConstant(intValue, p);
                Local<?> parameter = code.getParameter(p, argTypes[p]);
                Local<?> unboxedIfNecessary = boxIfRequired(code, parameter, temp);
                code.aput(args, intValue, unboxedIfNecessary);
            }
            code.invokeInterface(methodInvoke, invokeResult, localHandler,
                    localThis, thisMethod, args);
            generateCodeForReturnStatement(code, returnType, invokeResult, resultHolder,
                    aBoxedResult);

            // This code is executed if proxy is null: call the original super method.
            // This is required to handle the case of construction of an object which leaks the
            // "this" pointer.
            code.mark(handlerNullCase);
            for (int i = 0; i < superArgs2.length; ++i) {
                superArgs2[i] = code.getParameter(i, argTypes[i]);
            }
            if (void.class.equals(returnType)) {
                code.invokeSuper(superMethod, null, localThis, superArgs2);
                code.returnVoid();
            } else {
                invokeSuper(superMethod, code, localThis, superArgs2, superResult2);
                code.returnValue(superResult2);
            }

            /*
             * And to allow calling the original super method, the following is also generated:
             *
             *     public String super$doSomething$java_lang_String(Bar param0, int param1) {
             *          int result = super.doSomething(param0, param1);
             *          return result;
             *     }
             */
            // TODO: don't include a super_ method if the target is abstract!
            MethodId<G, ?> callsSuperMethod = generatedType.getMethod(
                    resultType, superMethodName(method), argTypes);
            Code superCode = dexMaker.declare(callsSuperMethod, PUBLIC);
            Local<G> superThis = superCode.getThis(generatedType);
            Local<?>[] superArgs = new Local<?>[argClasses.length];
            for (int i = 0; i < superArgs.length; ++i) {
                superArgs[i] = superCode.getParameter(i, argTypes[i]);
            }
            if (void.class.equals(returnType)) {
                superCode.invokeSuper(superMethod, null, superThis, superArgs);
                superCode.returnVoid();
            } else {
                Local<?> superResult = superCode.newLocal(resultType);
                invokeSuper(superMethod, superCode, superThis, superArgs, superResult);
                superCode.returnValue(superResult);
            }
        }
    }
View Full Code Here

Examples of com.iqbon.jcms.domain.Code

  private CodeDAO codeDAO;
  private Logger logger = Logger.getLogger(CodeDAOTest.class);
 
  protected void setUp() throws Exception {
    super.setUp();
    code = new Code();
    code.setGroupName("test");
    code.setKey("key");
    code.setParentKey("");
    code.setValue("value");
    codeDAO = (CodeDAO) BeanFactory.getBean("codeDAO");
View Full Code Here

Examples of com.mycila.testing.ea.Code

                    assertNull(testExecution.throwable());
                    assertTrue(testExecution.mustSkip());
                    assertEquals(flow.toString(), asList("prepare", "before", "beforeTest", "afterTest"), flow);
                } else if (testExecution.method().getName().equals("method4")) {
                    assertNotNull(testExecution.throwable());
                    assertThrow(AssertionError.class).withMessage("METHOD 4 ERROR").whenRunning(new Code() {
                        public void run() throws Throwable {
                            throw testExecution.throwable();
                        }
                    });
                    assertEquals(flow.toString(), asList("prepare", "before", "beforeTest", "method4", "afterTest"), flow);
View Full Code Here

Examples of com.sk89q.worldedit.util.formatting.component.Code

                tip.createFragment(Style.RED).append(String.format("There is no page %d (total number of pages is %d).", page + 1, pageTotal)).newLine();
            } else {
                List<CommandMapping> list = aliases.subList(offset, Math.min(offset + perPage, aliases.size()));

                tip.append("Type ");
                tip.append(new Code().append("//help ").append("<command> [<page>]"));
                tip.append(" for more information.").newLine();

                // Add each command
                for (CommandMapping mapping : list) {
                    StringBuilder builder = new StringBuilder();
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.