Examples of Frame


Examples of org.jboss.as.websockets.Frame

  }


  @Override
  protected void onReceivedFrame(final WebSocket socket) throws IOException {
    final Frame frame = socket.readFrame();

    switch (frame.getType()) {
      case Ping:
        socket.writeFrame(new PongFrame());
        break;
      case Binary:
        socket.writeFrame(TextFrame.from("Binary Frames Not Supported!"));
        break;
      default:
        if (frame.getType() != FrameType.Text) {
          return;
        }
    }

    final String text = ((TextFrame) frame).getText();
View Full Code Here

Examples of org.jboss.forge.furnace.proxy.javassist.bytecode.analysis.Frame

        return pos + increment;
    }

    private String getTopType(int pos) throws BadBytecode {
        Frame frame = getFrame(pos);
        if (frame == null)
            return null;

        CtClass clazz = frame.peek().getCtClass();
        return clazz != null ? Descriptor.toJvmName(clazz) : null;
    }
View Full Code Here

Examples of org.jruby.runtime.Frame

        throw new RaiseException((RubyException) exception);
    }

    private static void printExceptionSummary(ThreadContext context, Ruby runtime, RubyException rEx) {
        Frame currentFrame = context.getCurrentFrame();

        String msg = String.format("Exception `%s' at %s:%s - %s\n",
                rEx.getMetaClass(),
                currentFrame.getFile(), currentFrame.getLine() + 1,
                rEx.to_s());

        IRubyObject errorStream = runtime.getGlobalVariables().get("$stderr");
        errorStream.callMethod(context, "write", runtime.newString(msg));
    }
View Full Code Here

Examples of org.kc7bfi.jflac.frame.Frame

          e.printStackTrace();
        }
      }
    }
    try {
      Frame frame = decoder.readNextFrame();
      if (frame != null) {
        pcmData = decoder.decodeFrame(frame, null);
        System.arraycopy(pcmData.getData(), 0, buffer, 0, pcmData.getLen());
      }else{
        return -1;
View Full Code Here

Examples of org.mockito.asm.tree.analysis.Frame

            pw.println(method.name + method.desc);
            for (int j = 0; j < method.instructions.size(); ++j) {
                method.instructions.get(j).accept(mv);

                StringBuffer s = new StringBuffer();
                Frame f = frames[j];
                if (f == null) {
                    s.append('?');
                } else {
                    for (int k = 0; k < f.getLocals(); ++k) {
                        s.append(getShortName(f.getLocal(k).toString()))
                                .append(' ');
                    }
                    s.append(" : ");
                    for (int k = 0; k < f.getStackSize(); ++k) {
                        s.append(getShortName(f.getStack(k).toString()))
                                .append(' ');
                    }
                }
                while (s.length() < method.maxStack + method.maxLocals + 1) {
                    s.append(' ');
View Full Code Here

Examples of org.objectweb.asm.tree.analysis.Frame

        }
        return buf.toString();
    }

    public String[][] getTextTable() {
        Frame frame = null;
        String error1 = "";
        List lines = new ArrayList();
        String offsStr = null;
        for (int i = 0; i < text.size(); ++i) {
            Object o = text.get(i);
View Full Code Here

Examples of org.objectweb.asm.tree.analysis.Frame

        Integer insn = getBytecodeOffset(decompiledLine);
        if (error != null && insn != null && insn.intValue() == errorInsn) {
            return new String [] {error,error};
        }
        if (frames != null && insn != null) {
            Frame f = frames[insn.intValue()];
            if (f == null) {
                return null;
            }

            try {
                StringBuffer localsBuf = new StringBuffer();

                for (int i = 0; i < f.getLocals(); ++i) {
                    String s = f.getLocal(i).toString();
                    appendTypeName(i, useQualifiedNames, localsBuf, s);

                    for (Iterator it = localVariables.iterator(); it.hasNext();) {
                        LocalVariableNode lvnode = (LocalVariableNode) it.next();
                        int n = lvnode.index;
                        if( n==i) {
                          localsBuf.append( " : ").append( lvnode.name);
                        }
                    }

                    localsBuf.append('\n');
                }
                StringBuffer stackBuf = new StringBuffer();
                for (int i = 0; i < f.getStackSize(); ++i) {
                    String s = f.getStack(i).toString();
                    appendTypeName(i, useQualifiedNames, stackBuf, s);
                    stackBuf.append('\n');
                }
                return new String[] {localsBuf.toString(), stackBuf.toString()};
            } catch (IndexOutOfBoundsException e) {
View Full Code Here

Examples of org.objectweb.asm.tree.analysis.Frame

    public String[][][] getFrameTablesForInsn(final int insn, boolean useQualifiedNames) {
        if (error != null && insn == errorInsn) {
            return null;
        }
        if (frames != null && insn >= 0 && insn < frames.length) {
            Frame f = frames[insn];
            if (f == null) {
                return null;
            }

            try {
                ArrayList locals = new ArrayList();
                for (int i = 0; i < f.getLocals(); ++i) {
                    String varName = "";
                    for (Iterator it = localVariables.iterator(); it.hasNext();) {
                        LocalVariableNode lvnode = (LocalVariableNode) it.next();
                        int n = lvnode.index;
                        if( n==i) {
                            varName = lvnode.name;
                            // TODO take into account variable scope!
                            break;
                        }
                    }

                    locals.add( new String[] {
                        ""+i,
                        getTypeName( useQualifiedNames, f.getLocal(i).toString()),
                        varName});
                }

                ArrayList stack = new ArrayList();
                for (int i = 0; i < f.getStackSize(); ++i) {
                    stack.add( new String[] {
                        ""+i,
                        getTypeName( useQualifiedNames, f.getStack(i).toString())});
                }
                return new String[][][] {
                    (String[][]) locals.toArray( new String[ 3][]),
                    (String[][]) stack.toArray( new String[ 2][])};
            } catch (IndexOutOfBoundsException e) {
View Full Code Here

Examples of org.objectweb.asm.tree.analysis.Frame

      Frame[] frames = a.getFrames();
      AbstractInsnNode[] insns = mn.instructions.toArray();
      for (int i = 0; i < insns.length; ++i) {
        AbstractInsnNode insn = insns[i];
        if (insn.getOpcode() == CHECKCAST) {
          Frame f = frames[i];
          if (f != null && f.getStackSize() > 0) {
            Object operand = f.getStack(f.getStackSize() - 1);
            Class to, from;
            try {
              to = getClass(((TypeInsnNode) insn).desc);
              from = getClass(((BasicValue) operand).getType());
            } catch (ClassNotFoundException t) {
View Full Code Here

Examples of org.obolibrary.oboformat.model.Frame

    @SuppressWarnings("null")
    @Nonnull
    protected OWLOntology tr(@Nonnull OWLOntology in)
            throws OWLOntologyCreationException {
        setOwlOntology(in);
        Frame hf = obodoc.getHeaderFrame();
        Clause ontClause = hf.getClause(OboFormatTag.TAG_ONTOLOGY);
        if (ontClause != null) {
            String ontOboId = (String) ontClause.getValue();
            defaultIDSpace = ontOboId;
            IRI ontIRI;
            if (ontOboId.contains(":")) {
                ontIRI = IRI.create(ontOboId);
            } else {
                ontIRI = IRI.create(DEFAULT_IRI_PREFIX + ontOboId + ".owl");
            }
            Clause dvclause = hf.getClause(OboFormatTag.TAG_DATA_VERSION);
            if (dvclause != null) {
                String dv = dvclause.getValue().toString();
                IRI vIRI = IRI.create(DEFAULT_IRI_PREFIX + ontOboId + '/' + dv
                        + '/' + ontOboId + ".owl");
                OWLOntologyID oid = new OWLOntologyID(Optional.of(ontIRI),
                        Optional.of(vIRI));
                // if the ontology being read has a differet id from the one
                // that was passed in, update it
                // when parsing, the original ontology is likely an anonymous,
                // empty one
                if (!oid.equals(in.getOntologyID())) {
                    manager.applyChange(new SetOntologyID(in, oid));
                }
            } else {
                // if the ontology being read has a differet id from the one
                // that was passed in, update it
                // when parsing, the original ontology is likely an anonymous,
                // empty one
                if (!ontIRI
                        .equals(in.getOntologyID().getOntologyIRI().orNull())) {
                    manager.applyChange(new SetOntologyID(in,
                            new OWLOntologyID(Optional.of(ontIRI), Optional
                                    .<IRI> absent())));
                }
            }
        } else {
            defaultIDSpace = "TEMP";
            manager.applyChange(new SetOntologyID(in,
                    new OWLOntologyID(Optional.of(IRI.create(DEFAULT_IRI_PREFIX
                            + defaultIDSpace)), Optional.<IRI> absent())));
            // TODO - warn
        }
        trHeaderFrame(hf);
        for (Frame f : obodoc.getTypedefFrames()) {
            trTypedefToAnnotationProperty(f);
        }
        for (Frame f : obodoc.getTypedefFrames()) {
            trTypedefFrame(f);
        }
        for (Frame f : obodoc.getTermFrames()) {
            trTermFrame(f);
        }
        // TODO - individuals
        for (Clause cl : hf.getClauses(OboFormatTag.TAG_IMPORT)) {
            String path = getURI(cl.getValue().toString());
            IRI importIRI = IRI.create(path);
            manager.loadOntology(importIRI);
            AddImport ai = new AddImport(in,
                    fac.getOWLImportsDeclaration(importIRI));
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.