Examples of ClassDef


Examples of com.thoughtworks.qdox.parser.structs.ClassDef

        builder = new ModelBuilder();
    }

    public void testNumberOfClassesGrows() throws Exception {
        assertEquals(0, builder.getSource().getClasses().length);
        builder.beginClass(new ClassDef());
        builder.endClass();
        assertEquals(1, builder.getSource().getClasses().length);
        builder.beginClass(new ClassDef());
        builder.endClass();
        assertEquals(2, builder.getSource().getClasses().length);
    }
View Full Code Here

Examples of com.thoughtworks.qdox.parser.structs.ClassDef

        builder.endClass();
        assertEquals(2, builder.getSource().getClasses().length);
    }

    public void testSimpleClass() throws Exception {
        ClassDef cls = new ClassDef();
        cls.name = "Thingy";
        builder.beginClass(cls);
        builder.endClass();

        ClassDef cls2 = new ClassDef();
        cls2.name = "ThingyThing";
        builder.beginClass(cls2);
        builder.endClass();

        JavaSource source = builder.getSource();
View Full Code Here

Examples of com.thoughtworks.qdox.parser.structs.ClassDef

        assertEquals("ThingyThing", source.getClasses()[1].getName());
        assertEquals(source, source.getClasses()[0].getParentSource());
    }

    public void testInterface() throws Exception {
        ClassDef cls = new ClassDef();
        builder.beginClass(cls);
        builder.endClass();

        ClassDef cls2 = new ClassDef();
        cls2.type = ClassDef.INTERFACE;
        builder.beginClass(cls2);
        builder.endClass();

        JavaSource source = builder.getSource();
View Full Code Here

Examples of com.thoughtworks.qdox.parser.structs.ClassDef

        assertEquals(false, source.getClasses()[0].isInterface());
        assertEquals(true, source.getClasses()[1].isInterface());
    }

    public void testEnum() throws Exception {
        ClassDef cls = new ClassDef();
        builder.beginClass(cls);
        builder.endClass();

        ClassDef cls2 = new ClassDef();
        cls2.type = ClassDef.ENUM;
        builder.beginClass(cls2);
        builder.endClass();

        JavaSource source = builder.getSource();
View Full Code Here

Examples of com.vladium.jcd.cls.ClassDef

  }

  public byte[] instrument(String bundleid, String classname, byte[] bytes) {
    if (started) {
      try {
        ClassDef classdef = ClassDefParser.parseClass(bytes);
        InstrVisitor.InstrResult result = new InstrVisitor.InstrResult();
        new InstrVisitor(options).process(classdef, false, true, true,
            result);
        if (result.m_instrumented) {
          metadata.add(result.m_descriptor, true);
View Full Code Here

Examples of com.vladium.jcd.cls.ClassDef

  public byte[] instrument(final String bundleid, final String classname,
      final byte[] bytes) {
    if (started) {
      try {
        final ClassDef classdef = ClassDefParser.parseClass(bytes);
        final InstrVisitor.InstrResult result = process(classdef, true);
        if (result.m_instrumented) {
          ByteArrayOutputStream out = new ByteArrayOutputStream(
              bytes.length * 2);
          ClassWriter.writeClassTable(classdef, out);
View Full Code Here

Examples of com.vladium.jcd.cls.ClassDef

        + bundle.getSymbolicName());
    final Enumeration entries = bundle.findEntries("/", "*.class", true);
    while (entries != null && entries.hasMoreElements()) {
      final URL url = (URL) entries.nextElement();
      try {
        final ClassDef classdef = ClassDefParser.parseClass(url
            .openStream());
        if (!metadata.hasDescriptor(classdef.getName())) {
          process(classdef, false);
        }
      } catch (final IOException e) {
        System.err.println("Error while opening resource " + url
            + " in bundle " + bundle.getSymbolicName());
View Full Code Here

Examples of net.sf.joafip.store.entity.export_import.in.ClassDef

  public ObjectModelForImport createRootObject() throws ImportException {
    final StoreRoot4 storeRoot = new StoreRoot4();
    storeRoot.setDataModelIdentifier(currentDataModelIdentifier);
    setDataRecordIdentifierAssociatedToObject(storeRoot,
        Store.IDENTIFIER_FOR_ROOT);
    final ClassDef classDef = getClassReplacementDef(storeRoot.getClass());
    return new ObjectModelForImport(Store.IDENTIFIER_FOR_ROOT,
        classDef.getReplacementDef(), storeRoot,
        classDef.getReplacementClass(), false);
  }
View Full Code Here

Examples of org.allspice.bytecode.ClassDef

import org.allspice.bytecode.instructions.Return;
import org.allspice.bytecode.instructions.Store;

public class TestField extends MyTestCase {
  public ClassDef defadd(String type) {
    ClassDef cd = makeClass() ;
   
    FieldDef fd = new FieldDef(Scope.PUBLIC,new TypeName(type),"foo") ;
    cd = cd.addField(fd) ;
    {
      Var x = new Var(1,new TypeName(type)) ;
      MethodDef md = new MethodDef(TypeName.VOID,"setFoo",x) ;
      md = md.addInstructions(
          new Load(new Var(0,new TypeName("TestClass"))),
          new Load(x),
          new Store(new FieldRef(cd.name,new TypeName(type),"foo")),
          new Return(TypeCode.VOID)
          ) ;
      cd = cd.addMethod(md) ;
    }
    {
      MethodDef md = new MethodDef(new TypeName(type),"getFoo") ;
      md = md.addInstructions(
          new Load(new Var(0,new TypeName("TestClass"))),
          new Load(new FieldRef(cd.name,new TypeName(type),"foo")),
          new Return(TypeCode.getType(type))
          ) ;
      cd = cd.addMethod(md) ;
    }
    return cd ;
  }
View Full Code Here

Examples of org.jf.dexlib2.iface.ClassDef

        ImmutableMethodImplementation methodImpl = new ImmutableMethodImplementation(1, instructions, null, null);
        ImmutableMethod method = new ImmutableMethod("Lblah;", "blah", null, "V", AccessFlags.PUBLIC.getValue(), null,
                methodImpl);

        ClassDef classDef = new ImmutableClassDef("Lblah;", AccessFlags.PUBLIC.getValue(), "Ljava/lang/Object;", null,
                null, null, null, null, null, ImmutableList.of(method));

        DexFile dexFile = new ImmutableDexFile(ImmutableList.of(classDef));

        ClassPath classPath = ClassPath.fromClassPath(ImmutableList.<String>of(), ImmutableList.<String>of(), dexFile,
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.