congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
Modifier$ModifierKeyword.toFlagValue
Code IndexAdd Tabnine to your IDE (free)

How to use
toFlagValue
method
in
org.eclipse.jdt.core.dom.Modifier$ModifierKeyword

Best Java code snippets using org.eclipse.jdt.core.dom.Modifier$ModifierKeyword.toFlagValue (Showing top 20 results out of 315)

origin: org.eclipse.tycho/org.eclipse.jdt.core

/**
 * Returns the modifier corresponding to the given single-bit flag value,
 * or <code>null</code> if none or if more than one bit is set.
 * <p>
 * <code>fromFlagValue</code> is the converse of <code>toFlagValue</code>:
 * that is, <code>ModifierKind.fromFlagValue(k.toFlagValue()) == k</code> for
 * all modifier keywords <code>k</code>.
 * </p>
 *
 * @param flagValue the single-bit flag value for the modifier
 * @return the modifier keyword, or <code>null</code> if none
 * @see #toFlagValue()
 */
public static ModifierKeyword fromFlagValue(int flagValue) {
  for (Iterator it = KEYWORDS.values().iterator(); it.hasNext(); ) {
    ModifierKeyword k = (ModifierKeyword) it.next();
    if (k.toFlagValue() == flagValue) {
      return k;
    }
  }
  return null;
}
origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

/**
 * Returns the modifier corresponding to the given single-bit flag value,
 * or <code>null</code> if none or if more than one bit is set.
 * <p>
 * <code>fromFlagValue</code> is the converse of <code>toFlagValue</code>:
 * that is, <code>ModifierKind.fromFlagValue(k.toFlagValue()) == k</code> for
 * all modifier keywords <code>k</code>.
 * </p>
 *
 * @param flagValue the single-bit flag value for the modifier
 * @return the modifier keyword, or <code>null</code> if none
 * @see #toFlagValue()
 */
public static ModifierKeyword fromFlagValue(int flagValue) {
  for (Iterator it = KEYWORDS.values().iterator(); it.hasNext(); ) {
    ModifierKeyword k = (ModifierKeyword) it.next();
    if (k.toFlagValue() == flagValue) {
      return k;
    }
  }
  return null;
}
origin: org.eclipse.jdt/org.eclipse.jdt.core

/**
 * Returns the modifier corresponding to the given single-bit flag value,
 * or <code>null</code> if none or if more than one bit is set.
 * <p>
 * <code>fromFlagValue</code> is the converse of <code>toFlagValue</code>:
 * that is, <code>ModifierKind.fromFlagValue(k.toFlagValue()) == k</code> for
 * all modifier keywords <code>k</code>.
 * </p>
 *
 * @param flagValue the single-bit flag value for the modifier
 * @return the modifier keyword, or <code>null</code> if none
 * @see #toFlagValue()
 */
public static ModifierKeyword fromFlagValue(int flagValue) {
  for (Iterator it = KEYWORDS.values().iterator(); it.hasNext(); ) {
    ModifierKeyword k = (ModifierKeyword) it.next();
    if (k.toFlagValue() == flagValue) {
      return k;
    }
  }
  return null;
}
origin: org.eclipse.tycho/org.eclipse.jdt.core

/**
 * Returns the module modifiers explicitly specified on this declaration.
 * <p>
 * This method is a convenience method that
 * computes these flags from <code>modifiers()</code>.
 * </p>
 *
 * @return the bit-wise or of <code>ModuleModifier</code> constants
 * @see ModuleModifier
 */
public int getModifiers() {
  // do not cache - performance could be improved by caching computed flags
  // but this would require tracking changes to this.modifiers
  int computedModifierFlags = ModuleModifier.NONE;
  for (Iterator it = modifiers().iterator(); it.hasNext(); ) {
    Object x = it.next();
    if (x instanceof ModuleModifier) {
      computedModifierFlags |= ((Modifier) x).getKeyword().toFlagValue();
    }
  }
  return computedModifierFlags;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

/**
 * Does the specified member need further visibility adjustment?
 *
 * @param member the member to test
 * @param threshold the visibility threshold to test for
 * @param adjustments the map of members to visibility adjustments
 * @return <code>true</code> if the member needs further adjustment, <code>false</code> otherwise
 */
public static boolean needsVisibilityAdjustments(final IMember member, final int threshold, final Map<IMember, IncomingMemberVisibilityAdjustment> adjustments) {
  Assert.isNotNull(member);
  Assert.isTrue(isVisibilityModifier(threshold));
  Assert.isNotNull(adjustments);
  final IncomingMemberVisibilityAdjustment adjustment= adjustments.get(member);
  if (adjustment != null) {
    final ModifierKeyword keyword= adjustment.getKeyword();
    return hasLowerVisibility(keyword == null ? Modifier.NONE : keyword.toFlagValue(), threshold);
  }
  return true;
}
origin: org.eclipse/org.eclipse.jdt.ui

/**
 * Does the specified member need further visibility adjustment?
 * 
 * @param member the member to test
 * @param threshold the visibility threshold to test for
 * @param adjustments the map of members to visibility adjustments
 * @return <code>true</code> if the member needs further adjustment, <code>false</code> otherwise
 */
public static boolean needsVisibilityAdjustments(final IMember member, final int threshold, final Map adjustments) {
  Assert.isNotNull(member);
  Assert.isTrue(isVisibilityModifier(threshold));
  Assert.isNotNull(adjustments);
  final IncomingMemberVisibilityAdjustment adjustment= (IncomingMemberVisibilityAdjustment) adjustments.get(member);
  if (adjustment != null) {
    final ModifierKeyword keyword= adjustment.getKeyword();
    return hasLowerVisibility(keyword == null ? Modifier.NONE : keyword.toFlagValue(), threshold);
  }
  return true;
}
origin: org.eclipse/org.eclipse.jdt.ui

/**
 * Adjusts the visibility of the specified member.
 * 
 * @param element the "source" point from which to calculate the visibility
 * @param referencedMovedElement the moved element which may be adjusted in visibility
 * @param monitor the progress monitor to use
 * @throws JavaModelException if the visibility adjustment could not be computed
 */
private void adjustIncomingVisibility(final IJavaElement element, IMember referencedMovedElement, final IProgressMonitor monitor) throws JavaModelException {
  final ModifierKeyword threshold= getVisibilityThreshold(element, referencedMovedElement, monitor);
  int flags= referencedMovedElement.getFlags();
  IType declaring= referencedMovedElement.getDeclaringType();
  if (declaring.isInterface())
    return;
  if (hasLowerVisibility(flags, threshold == null ? Modifier.NONE : threshold.toFlagValue()) && needsVisibilityAdjustment(referencedMovedElement, threshold))
    fAdjustments.put(referencedMovedElement, new IncomingMemberVisibilityAdjustment(referencedMovedElement, threshold, RefactoringStatus.createStatus(fVisibilitySeverity, Messages.format(getMessage(referencedMovedElement), new String[] { getLabel(referencedMovedElement), getLabel(threshold)}), JavaStatusContext.create(referencedMovedElement), null, RefactoringStatusEntry.NO_CODE, null)));
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

/**
 * Does the specified member need further visibility adjustment?
 *
 * @param member the member to test
 * @param threshold the visibility threshold to test for
 * @param adjustments the map of members to visibility adjustments
 * @return <code>true</code> if the member needs further adjustment, <code>false</code> otherwise
 */
public static boolean needsVisibilityAdjustments(final IMember member, final int threshold, final Map<IMember, IncomingMemberVisibilityAdjustment> adjustments) {
  Assert.isNotNull(member);
  Assert.isTrue(isVisibilityModifier(threshold));
  Assert.isNotNull(adjustments);
  final IncomingMemberVisibilityAdjustment adjustment= adjustments.get(member);
  if (adjustment != null) {
    final ModifierKeyword keyword= adjustment.getKeyword();
    return hasLowerVisibility(keyword == null ? Modifier.NONE : keyword.toFlagValue(), threshold);
  }
  return true;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

/**
 * Adjusts the visibility of the specified member.
 *
 * @param element the "source" point from which to calculate the visibility
 * @param referencedMovedElement the moved element which may be adjusted in visibility
 * @param monitor the progress monitor to use
 * @throws JavaModelException if the visibility adjustment could not be computed
 */
private void adjustIncomingVisibility(final IJavaElement element, IMember referencedMovedElement, final IProgressMonitor monitor) throws JavaModelException {
  final ModifierKeyword threshold= getVisibilityThreshold(element, referencedMovedElement, monitor);
  int flags= referencedMovedElement.getFlags();
  IType declaring= referencedMovedElement.getDeclaringType();
  if (declaring != null && declaring.isInterface() || referencedMovedElement instanceof IField && Flags.isEnum(referencedMovedElement.getFlags()))
    return;
  if (hasLowerVisibility(flags, threshold == null ? Modifier.NONE : threshold.toFlagValue()) && needsVisibilityAdjustment(referencedMovedElement, threshold))
    fAdjustments.put(referencedMovedElement, new IncomingMemberVisibilityAdjustment(referencedMovedElement, threshold, RefactoringStatus.createStatus(fVisibilitySeverity, Messages.format(getMessage(referencedMovedElement), new String[] { getLabel(referencedMovedElement), getLabel(threshold)}), JavaStatusContext.create(referencedMovedElement), null, RefactoringStatusEntry.NO_CODE, null)));
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

public static void installLinkedVisibilityProposals(LinkedProposalModel linkedProposalModel, ASTRewrite rewrite, List<IExtendedModifier> modifiers, boolean inInterface, String groupId) {
  ASTNode modifier= findVisibilityModifier(modifiers);
  if (modifier != null) {
    int selected= ((Modifier) modifier).getKeyword().toFlagValue();
    LinkedProposalPositionGroup positionGroup= linkedProposalModel.getPositionGroup(groupId, true);
    positionGroup.addPosition(rewrite.track(modifier), false);
    positionGroup.addProposal(new ModifierLinkedModeProposal(selected, 10));
    // add all others
    int[] flagValues= inInterface ? new int[] { Modifier.PUBLIC, 0 } : new int[] { Modifier.PUBLIC, 0, Modifier.PROTECTED, Modifier.PRIVATE };
    for (int i= 0; i < flagValues.length; i++) {
      if (flagValues[i] != selected) {
        positionGroup.addProposal(new ModifierLinkedModeProposal(flagValues[i], 9 - i));
      }
    }
  }
}
origin: org.eclipse/org.eclipse.jdt.ui

public static void installLinkedVisibilityProposals(LinkedProposalModel linkedProposalModel, ASTRewrite rewrite, List modifiers, boolean inInterface) {
  ASTNode modifier= findVisibilityModifier(modifiers);
  if (modifier != null) {
    int selected= ((Modifier) modifier).getKeyword().toFlagValue();
    
    LinkedProposalPositionGroup positionGroup= linkedProposalModel.getPositionGroup(KEY_MODIFIER, true);
    positionGroup.addPosition(rewrite.track(modifier), false);
    positionGroup.addProposal(new ModifierLinkedModeProposal(selected, 10));
    
    // add all others
    int[] flagValues= inInterface ? new int[] { Modifier.PUBLIC, 0 } : new int[] { Modifier.PUBLIC, 0, Modifier.PROTECTED, Modifier.PRIVATE };
    for (int i= 0; i < flagValues.length; i++) {
      if (flagValues[i] != selected) {
        positionGroup.addProposal(new ModifierLinkedModeProposal(flagValues[i], 9 - i));
      }
    }
  } 
}

origin: org.eclipse.jdt/org.eclipse.jdt.ui

public static void installLinkedVisibilityProposals(LinkedProposalModel linkedProposalModel, ASTRewrite rewrite, List<IExtendedModifier> modifiers, boolean inInterface, String groupId) {
  ASTNode modifier= findVisibilityModifier(modifiers);
  if (modifier != null) {
    int selected= ((Modifier) modifier).getKeyword().toFlagValue();
    LinkedProposalPositionGroup positionGroup= linkedProposalModel.getPositionGroup(groupId, true);
    positionGroup.addPosition(rewrite.track(modifier), false);
    positionGroup.addProposal(new ModifierLinkedModeProposal(selected, 10));
    // add all others
    int[] flagValues= inInterface ? new int[] { Modifier.PUBLIC, 0 } : new int[] { Modifier.PUBLIC, 0, Modifier.PROTECTED, Modifier.PRIVATE };
    for (int i= 0; i < flagValues.length; i++) {
      if (flagValues[i] != selected) {
        positionGroup.addProposal(new ModifierLinkedModeProposal(flagValues[i], 9 - i));
      }
    }
  }
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

/**
 * Adjusts the visibility of the specified member.
 *
 * @param element the "source" point from which to calculate the visibility
 * @param referencedMovedElement the moved element which may be adjusted in visibility
 * @param monitor the progress monitor to use
 * @throws JavaModelException if the visibility adjustment could not be computed
 */
private void adjustIncomingVisibility(final IJavaElement element, IMember referencedMovedElement, final IProgressMonitor monitor) throws JavaModelException {
  final ModifierKeyword threshold= getVisibilityThreshold(element, referencedMovedElement, monitor);
  int flags= referencedMovedElement.getFlags();
  IType declaring= referencedMovedElement.getDeclaringType();
  if (declaring != null && declaring.isInterface() || referencedMovedElement instanceof IField && Flags.isEnum(referencedMovedElement.getFlags()))
    return;
  if (hasLowerVisibility(flags, threshold == null ? Modifier.NONE : threshold.toFlagValue()) && needsVisibilityAdjustment(referencedMovedElement, threshold))
    fAdjustments.put(referencedMovedElement, new IncomingMemberVisibilityAdjustment(referencedMovedElement, threshold, RefactoringStatus.createStatus(fVisibilitySeverity, Messages.format(getMessage(referencedMovedElement), new String[] { getLabel(referencedMovedElement), getLabel(threshold)}), JavaStatusContext.create(referencedMovedElement), null, RefactoringStatusEntry.NO_CODE, null)));
}
origin: eclipse/eclipse.jdt.ls

public static void installLinkedVisibilityProposals(LinkedProposalModelCore linkedProposalModel, ASTRewrite rewrite, List<IExtendedModifier> modifiers, boolean inInterface, String groupId) {
  ASTNode modifier = findVisibilityModifier(modifiers);
  if (modifier != null) {
    int selected = ((Modifier) modifier).getKeyword().toFlagValue();
    LinkedProposalPositionGroupCore positionGroup = linkedProposalModel.getPositionGroup(groupId, true);
    positionGroup.addPosition(rewrite.track(modifier), false);
    positionGroup.addProposal(new ModifierLinkedModeProposal(selected, 10));
    // add all others
    int[] flagValues = inInterface ? new int[] { Modifier.PUBLIC, 0 } : new int[] { Modifier.PUBLIC, 0, Modifier.PROTECTED, Modifier.PRIVATE };
    for (int i = 0; i < flagValues.length; i++) {
      if (flagValues[i] != selected) {
        positionGroup.addProposal(new ModifierLinkedModeProposal(flagValues[i], 9 - i));
      }
    }
  }
}
origin: org.eclipse.jdt/org.eclipse.jdt.core.manipulation

public static Modifier findModifierNode(int flag, List<IExtendedModifier> modifiers) {
  for (int i= 0; i < modifiers.size(); i++) {
    Object curr= modifiers.get(i);
    if (curr instanceof Modifier && ((Modifier) curr).getKeyword().toFlagValue() == flag) {
      return (Modifier) curr;
    }
  }
  return null;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

public static Modifier findModifierNode(int flag, List<IExtendedModifier> modifiers) {
  for (int i= 0; i < modifiers.size(); i++) {
    Object curr= modifiers.get(i);
    if (curr instanceof Modifier && ((Modifier) curr).getKeyword().toFlagValue() == flag) {
      return (Modifier) curr;
    }
  }
  return null;
}
origin: org.eclipse/org.eclipse.jdt.ui

public static Modifier findModifierNode(int flag, List modifiers) {
  for (int i= 0; i < modifiers.size(); i++) {
    Object curr= modifiers.get(i);
    if (curr instanceof Modifier && ((Modifier) curr).getKeyword().toFlagValue() == flag) {
      return (Modifier) curr;
    }
  }
  return null;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

/**
 * Does the specified modifier keyword represent a lower visibility than the required threshold?
 *
 * @param keyword the visibility keyword to test, or <code>null</code> for default visibility
 * @param threshold the visibility threshold keyword to compare with, or <code>null</code> to compare with default visibility
 * @return <code>true</code> if the visibility is lower than required, <code>false</code> otherwise
 */
public static boolean hasLowerVisibility(final ModifierKeyword keyword, final ModifierKeyword threshold) {
  Assert.isTrue(isVisibilityKeyword(keyword));
  Assert.isTrue(isVisibilityKeyword(threshold));
  return hasLowerVisibility(keyword != null ? keyword.toFlagValue() : Modifier.NONE, threshold != null ? threshold.toFlagValue() : Modifier.NONE);
}
origin: org.eclipse/org.eclipse.jdt.ui

/**
 * Does the specified modifier keyword represent a lower visibility than the required threshold?
 * 
 * @param keyword the visibility keyword to test, or <code>null</code> for default visibility
 * @param threshold the visibility threshold keyword to compare with, or <code>null</code> to compare with default visibility
 * @return <code>true</code> if the visibility is lower than required, <code>false</code> otherwise
 */
public static boolean hasLowerVisibility(final ModifierKeyword keyword, final ModifierKeyword threshold) {
  Assert.isTrue(isVisibilityKeyword(keyword));
  Assert.isTrue(isVisibilityKeyword(threshold));
  return hasLowerVisibility(keyword != null ? keyword.toFlagValue() : Modifier.NONE, threshold != null ? threshold.toFlagValue() : Modifier.NONE);
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

/**
 * Does the specified modifier keyword represent a lower visibility than the required threshold?
 *
 * @param keyword the visibility keyword to test, or <code>null</code> for default visibility
 * @param threshold the visibility threshold keyword to compare with, or <code>null</code> to compare with default visibility
 * @return <code>true</code> if the visibility is lower than required, <code>false</code> otherwise
 */
public static boolean hasLowerVisibility(final ModifierKeyword keyword, final ModifierKeyword threshold) {
  Assert.isTrue(isVisibilityKeyword(keyword));
  Assert.isTrue(isVisibilityKeyword(threshold));
  return hasLowerVisibility(keyword != null ? keyword.toFlagValue() : Modifier.NONE, threshold != null ? threshold.toFlagValue() : Modifier.NONE);
}
org.eclipse.jdt.core.domModifier$ModifierKeywordtoFlagValue

Javadoc

Returns the modifier flag value corresponding to this modifier keyword. These flag values are as described in the Java Virtual Machine Specification.

Popular methods of Modifier$ModifierKeyword

  • toString
    Returns the keyword for the modifier.
  • fromFlagValue
    Returns the modifier corresponding to the given single-bit flag value, or null if none or if more t
  • toKeyword
    Returns the modifier corresponding to the given string, or null if none.toKeyword is the converse of

Popular in Java

  • Running tasks concurrently on multiple threads
  • getContentResolver (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • addToBackStack (FragmentTransaction)
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • JButton (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now