Package com.strobel.assembler.metadata

Examples of com.strobel.assembler.metadata.TypeReference.resolve()


            if (name != null) {
                return name;
            }

            if (!nameSource.isDefinition()) {
                final TypeDefinition resolvedType = nameSource.resolve();

                if (resolvedType != null) {
                    nameSource = resolvedType;
                }
            }
View Full Code Here


                SwitchMapInfo info = _switchMaps.get(enclosingTypeName);

                if (info == null) {
                    _switchMaps.put(enclosingTypeName, info = new SwitchMapInfo(enclosingTypeName));

                    final TypeDefinition resolvedType = enclosingType.resolve();

                    if (resolvedType != null) {
                        AstBuilder astBuilder = context.getUserData(Keys.AST_BUILDER);

                        if (astBuilder == null) {
View Full Code Here

        if (targetResult == null || targetResult.getType() == null) {
            return null;
        }

        final TypeReference declaringType = member.getDeclaringType();
        final TypeDefinition resolvedDeclaringType = declaringType.resolve();

        final boolean isSubType = MetadataHelper.isSubType(
            targetResult.getType(),
            resolvedDeclaringType != null ? resolvedDeclaringType : declaringType
        );
View Full Code Here

    @Override
    public Void visitObjectCreationExpression(final ObjectCreationExpression node, final Void _) {
        super.visitObjectCreationExpression(node, _);

        final TypeReference type = node.getType().getUserData(Keys.TYPE_REFERENCE);
        final TypeDefinition resolvedType = type != null ? type.resolve() : null;

        if (resolvedType != null && resolvedType.isLocalClass()) {
            List<ObjectCreationExpression> instantiations = _instantiations.get(type);

            if (instantiations == null) {
View Full Code Here

                          ".class");
                  TypeReference type = Model.metadataSystem
                      .lookupType(internalName);
                  TypeDefinition resolvedType = null;
                  if (type == null
                      || ((resolvedType = type.resolve()) == null)) {
                    throw new Exception(
                        "Unable to resolve type.");
                  }
                  StringWriter stringwriter = new StringWriter();
                  DecompilationOptions decompilationOptions;
View Full Code Here

        try {
          Thread.sleep(500);
          String internalName = FindBox.class.getName();
          TypeReference type = metadataSystem.lookupType(internalName);
          TypeDefinition resolvedType = null;
          if ((type == null) || ((resolvedType = type.resolve()) == null)) {
            return;
          }
          StringWriter stringwriter = new StringWriter();
          settings.getLanguage().decompileType(resolvedType,
              new PlainTextOutput(stringwriter), decompilationOptions);
View Full Code Here

            out.putNextEntry(etn);
            try {
              String internalName = StringUtilities.removeRight(entry.getName(), ".class");
              TypeReference type = metadataSystem.lookupType(internalName);
              TypeDefinition resolvedType = null;
              if ((type == null) || ((resolvedType = type.resolve()) == null)) {
                throw new Exception("Unable to resolve type.");
              }
              Writer writer = new OutputStreamWriter(out);
              settings.getLanguage().decompileType(resolvedType,
                  new PlainTextOutput(writer), decompilationOptions);
View Full Code Here

    DecompilationOptions decompilationOptions = new DecompilationOptions();
    decompilationOptions.setSettings(settings);
    decompilationOptions.setFullDecompilation(true);

    TypeDefinition resolvedType = null;
    if (type == null || ((resolvedType = type.resolve()) == null)) {
      throw new Exception("Unable to resolve type.");
    }
    StringWriter stringwriter = new StringWriter();
    settings.getLanguage().decompileType(resolvedType,
        new PlainTextOutput(stringwriter), decompilationOptions);
View Full Code Here

    @Override
    public Void visitObjectCreationExpression(final ObjectCreationExpression node, final Void _) {
        super.visitObjectCreationExpression(node, _);

        final TypeReference type = node.getType().getUserData(Keys.TYPE_REFERENCE);
        final TypeDefinition resolvedType = type != null ? type.resolve() : null;

        if (resolvedType != null && isLocalOrAnonymous(resolvedType)) {
            List<ObjectCreationExpression> instantiations = _instantiations.get(type);

            if (instantiations == null) {
View Full Code Here

                SwitchMapInfo info = _switchMaps.get(enclosingTypeName);

                if (info == null) {
                    _switchMaps.put(enclosingTypeName, info = new SwitchMapInfo(enclosingTypeName));

                    final TypeDefinition resolvedType = enclosingType.resolve();

                    if (resolvedType != null) {
                        AstBuilder astBuilder = context.getUserData(Keys.AST_BUILDER);

                        if (astBuilder == null) {
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.