Examples of IField


Examples of org.codehaus.janino.IClass.IField

            this.compileError("Could not load \"" + Java.join(typeName, ".") + "\"", ssid.getLocation());
            return;
        }

        // Static field?
        IField iField = iClass.getDeclaredIField(name);
        if (iField != null) {
            if (!iField.isStatic()) {
                this.compileError(
                    "Field \"" + name + "\" of \"" + Java.join(typeName, ".") + "\" must be static",
                    ssid.getLocation()
                );
            }
View Full Code Here

Examples of org.codehaus.janino.IClass.IField

    /*package*/ IClass.IField[] getIFields(final Java.FieldDeclaration fd) {
        IClass.IField[] res = new IClass.IField[fd.variableDeclarators.length];
        for (int i = 0; i < res.length; ++i) {
            final Java.VariableDeclarator vd = fd.variableDeclarators[i];
            res[i] = this.resolve(fd.getDeclaringType()).new IField() {

                // Implement IMember.
                public Access getAccess() {
                    switch (fd.modifiers & Mod.PPP) {
                    case Mod.PRIVATE:
View Full Code Here

Examples of org.codehaus.janino.IClass.IField

            }
        }

        // JLS3 6.5.2.BL1.B1.B2.2 Static field imported through static-import-on-demand.
        {
            IField importedField = null;
            for (Iterator it = this.staticImportsOnDemand.iterator(); it.hasNext();) {
                IClass iClass = (IClass) it.next();
                IField f = iClass.getDeclaredIField(identifier);
                if (f != null) {
                        // JLS3 7.5.4 Static-Import-on-Demand Declaration
                        if (!UnitCompiler.this.isAccessible(f, enclosingBlockStatement)) continue;

                        if (importedField != null) {
                            UnitCompiler.this.compileError(
                                "Ambiguous static field import: \""
                                + importedField.toString()
                                + "\" vs. \""
                                + f.toString()
                                + "\""
                            );
                        }
                        importedField = f;
                    }
View Full Code Here

Examples of org.eclipse.dltk.core.IField

   
    IField[] fields = type.getFields();
    Map result = new LinkedHashMap();
    for (int i = 0; i < fields.length; i++) {
               
      IField field = fields[i];
     
      int flags = field.getFlags();
      if (PHPFlags.isStatic(flags) || PHPFlags.isConstant(flags)) {
          continue;
      }
     
      String name = field.getElementName().replace("$", "");
            String getter = "get" + name.toLowerCase();
            String setter = "set" + name.toLowerCase();
     
      List l = new ArrayList(2);
      List<GetterSetterEntry> entries = new ArrayList<GetterSetterEntry>();
View Full Code Here

Examples of org.eclipse.dltk.core.IField

  }
 
  public void visitAll() {
    IType moduleType = topLevelElement;
   
    IField variable = topLevelElement.getField("Variable");
    IField variable2 = topLevelElement.getField("Variable2");
    IField varExtended = topLevelElement.getField("VarExtended");
    IField varExtended2 = topLevelElement.getField("VarExtended2");
    IField autoVar = topLevelElement.getField("AutoVar");
    IField autoVar2 = topLevelElement.getField("AutoVar2");
   
    IMethod function_ = topLevelElement.getMethod("Function");
    IMethod autoFunction = topLevelElement.getMethod("AutoFunction");
   
    IType struct_ = topLevelElement.getType("Struct");
    IType union_ = topLevelElement.getType("Union");
    IType class_ = topLevelElement.getType("Class");
    IType interface_ = topLevelElement.getType("Interface");
    IType template = topLevelElement.getType("Template");
    IType enum_ = topLevelElement.getType("Enum");
    IField enum_memberA = topLevelElement.getType("Enum").getField("EnumMemberA");
    IField enum_memberB = topLevelElement.getType("Enum").getField("EnumMemberB");
    IType mixin = topLevelElement.getType("Mixin");
    IType aliasVarDecl = topLevelElement.getType("AliasVarDecl");
    IType aliasFunctionDecl = topLevelElement.getType("AliasFunctionDecl");
    IType aliasFrag = topLevelElement.getType("AliasFrag");
    IType aliasFrag2 = topLevelElement.getType("AliasFrag2");
   
    // Nested elements:
    IField otherClass_fieldA = topLevelElement.getType("OtherClass").getField("fieldA");
    IMethod otherClass_methodB = topLevelElement.getType("OtherClass").getMethod("methodB");
    IMethod otherClass_this = topLevelElement.getType("OtherClass").getMethod("this");
    final IType otherTemplate = topLevelElement.getType("OtherTemplate");
    IType _OtherTemplate_TplNestedClass = otherTemplate.getType("TplNestedClass");
    IMethod tplFunc = otherTemplate.getType("TplNestedClass").getMethod("tplFunc");
View Full Code Here

Examples of org.eclipse.dltk.core.IField

      }
      for (int i = 0; i < fields.length; i++) {
        if (fields[i] == null) {
          continue;
        }
        IField iField = fields[i];
        IPath path = iField.getPath();
        String fullyQualifiedName = parseFileName(path.toString());
        impFields.put(iField.getElementName(), iField);
        impFields.put(fullyQualifiedName + "." + iField.getElementName(), iField);
      }
    }
View Full Code Here

Examples of org.eclipse.jdt.core.IField

      boolean needsSave = cu.isWorkingCopy();
      ImportsManager imports = new ImportsManager(cu);
      lineDelimiter = StubUtility.getLineDelimiterUsed(aspect);

      // Write crosscut and format it
      IField field = fCrosscutPage.writeCrosscut(aspect, fCrosscutTypeDialogField.getSelectionIndex(), imports,
          new SubProgressMonitor(monitor, 2), lineDelimiter);
      ISourceRange range = field.getSourceRange();
      IBuffer buf = cu.getBuffer();
      String originalContent = buf.getText(range.getOffset(), range.getLength());
      String formattedContent = CodeFormatterUtil.format(CodeFormatter.K_CLASS_BODY_DECLARATIONS, originalContent, 1, null,
          lineDelimiter, field.getJavaProject());
      buf.replace(range.getOffset(), range.getLength(), formattedContent);
      if (!cu.isWorkingCopy())
        buf.save(null, false);

      imports.create(needsSave, new SubProgressMonitor(monitor, 1));
View Full Code Here

Examples of org.eclipse.jdt.core.IField

     * @return Unique field name
     */
    public String getUniqueFieldName(IType aspect) {
        int fieldCount = 1;
        String result;
        IField field;
        do {
            result = "c" + fieldCount++;
            field = aspect.getField(result);
        } while (field.exists());
        return result;
    }
View Full Code Here

Examples of org.eclipse.jdt.core.IField

        String fieldName = getFieldName();
        IType[] allTypes = getAllTypes(cu);
        for (int i = 0; i < allTypes.length; i++) {
            IType type = allTypes[i];
            IField field = type.getField(fieldName);
            if (field == null) {
                continue;
            }
            String constant = (String) field.getConstant();
            if(constant != null){
                constant = constant.substring(1, constant.length() - 1);
            }
            String expectedPath = packagePath + constant + ".class";
            String name = JdtUtils.getByteCodePath(type);
View Full Code Here

Examples of org.eclipse.jdt.core.IField

 
  public boolean renameField(IType type, IProgressMonitor monitor) {
    String lastName = adapter.getLastName();
    String name = adapter.getName();
    if (lastName != null && !lastName.equals(name)) {
      IField lastField = type.getField(lastName);
      try {
        int flags = RenameSupport.UPDATE_GETTER_METHOD
            | RenameSupport.UPDATE_REFERENCES
            | RenameSupport.UPDATE_SETTER_METHOD;
        RenameSupport rs = RenameSupport.create(lastField, name, flags);
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.