当前位置: 首页>>代码示例>>Java>>正文


Java StringBuilderSpinAllocator.alloc方法代码示例

本文整理汇总了Java中com.intellij.util.StringBuilderSpinAllocator.alloc方法的典型用法代码示例。如果您正苦于以下问题:Java StringBuilderSpinAllocator.alloc方法的具体用法?Java StringBuilderSpinAllocator.alloc怎么用?Java StringBuilderSpinAllocator.alloc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.util.StringBuilderSpinAllocator的用法示例。


在下文中一共展示了StringBuilderSpinAllocator.alloc方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAllModifierProperties

import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
public String getAllModifierProperties( LightModifierList modifierList )
{
  final StringBuilder builder = StringBuilderSpinAllocator.alloc();
  try
  {
    for( String modifier : modifierList.getModifiers() )
    {
      if( !PsiModifier.PACKAGE_LOCAL.equals( modifier ) )
      {
        builder.append( modifier ).append( ' ' );
      }
    }
    return builder.toString();
  }
  finally
  {
    StringBuilderSpinAllocator.dispose( builder );
  }
}
 
开发者ID:manifold-systems,项目名称:manifold-ij,代码行数:20,代码来源:ManLightMethodBuilderImpl.java

示例2: getCustomPattern

import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
@Nullable
private Pattern getCustomPattern() {
  String customFilter = getCustomFilter();
  if (myCustomPattern == null && customFilter != null) {
    final StringBuilder buf = StringBuilderSpinAllocator.alloc();
    try {
      for (int i = 0; i < customFilter.length(); i++) {
        final char c = customFilter.charAt(i);
        if (Character.isLetterOrDigit(c)) {
          buf.append(Character.toUpperCase(c));
        }
        else {
          buf.append("\\").append(c);
        }
      }
      myCustomPattern = Pattern.compile(".*" + buf + ".*", Pattern.DOTALL);
    }
    finally {
      StringBuilderSpinAllocator.dispose(buf);
    }
  }
  return myCustomPattern;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:LogFilterModel.java

示例3: getDisplayName

import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
public String getDisplayName() {
  final StringBuilder buffer = StringBuilderSpinAllocator.alloc();
  try {
    if(isValid()) {
      final String className = getClassName();
      final boolean classNameExists = className != null && className.length() > 0;
      if (classNameExists) {
        buffer.append(className);
      }
      if(getMethodName() != null) {
        if (classNameExists) {
          buffer.append(".");
        }
        buffer.append(getMethodName());
      }
    }
    else {
      buffer.append(DebuggerBundle.message("status.breakpoint.invalid"));
    }
    return buffer.toString();
  }
  finally {
    StringBuilderSpinAllocator.dispose(buffer);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:MethodBreakpoint.java

示例4: rebuildMethodFromString

import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
private PsiMethod rebuildMethodFromString() {
  final StringBuilder builder = StringBuilderSpinAllocator.alloc();
  try {
    builder.append(getAllModifierProperties((LightModifierList) getModifierList()));
    PsiType returnType = getReturnType();
    if (null != returnType) {
      builder.append(returnType.getCanonicalText()).append(' ');
    }
    builder.append(getName());
    builder.append('(');
    if (getParameterList().getParametersCount() > 0) {
      for (PsiParameter parameter : getParameterList().getParameters()) {
        builder.append(parameter.getType().getCanonicalText()).append(' ').append(parameter.getName()).append(',');
      }
      builder.deleteCharAt(builder.length() - 1);
    }
    builder.append(')');
    builder.append('{').append("  ").append('}');

    PsiElementFactory elementFactory = JavaPsiFacade.getInstance(getManager().getProject()).getElementFactory();
    return elementFactory.createMethodFromText(builder.toString(), getContainingClass());
  } finally {
    StringBuilderSpinAllocator.dispose(builder);
  }
}
 
开发者ID:SiimKinks,项目名称:sqlitemagic,代码行数:26,代码来源:SqliteMagicLightMethodBuilder.java

示例5: ExecuteCompositeTargetEvent

import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
public ExecuteCompositeTargetEvent(String[] targetNames) {
  myTargetNames = targetNames;
  final StringBuilder builder = StringBuilderSpinAllocator.alloc();
  try {
    builder.append("[");
    for (int idx = 0; idx < targetNames.length; idx++) {
      if (idx > 0) {
        builder.append(",");
      }
      builder.append(targetNames[idx]);
    }
    builder.append("]");
    myCompositeName = builder.toString();
  }
  finally {
    StringBuilderSpinAllocator.dispose(builder);
  }
  myPresentableName = myCompositeName;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ExecuteCompositeTargetEvent.java

示例6: createParameterList

import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
@NotNull
@Override
public PsiParameterList createParameterList(@NotNull @NonNls String[] names, @NotNull PsiType[] types) throws IncorrectOperationException {
  StringBuilder builder = StringBuilderSpinAllocator.alloc();
  builder.append("def foo(");
  for (int i = 0; i < names.length; i++) {
    String name = names[i];
    final PsiType type = types[i];
    if (type != null) {
      builder.append(type.getCanonicalText());
      builder.append(' ');
    }
    builder.append(name);
    builder.append(',');
  }
  if (names.length > 0) {
    builder.delete(builder.length() - 1, builder.length());
  }
  builder.append("){}");
  final GrMethod method = createMethodFromText(builder);
  return method.getParameterList();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:GroovyPsiElementFactoryImpl.java

示例7: composeTooltipMessage

import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
public String composeTooltipMessage() {
  final StringBuilder buf = StringBuilderSpinAllocator.alloc();
  try {
    buf.append("<html><body>");
    if (myProblemDescriptions != null) {
      int problems = 0;
      for (ProjectStructureProblemDescription problemDescription : myProblemDescriptions) {
        buf.append(XmlStringUtil.escapeString(problemDescription.getMessage(false))).append("<br>");
        problems++;
        if (problems >= 10 && myProblemDescriptions.size() > 12) {
          buf.append(myProblemDescriptions.size() - problems).append(" more problems...<br>");
          break;
        }
      }
    }
    buf.append("</body></html>");
    return buf.toString();
  }
  finally {
    StringBuilderSpinAllocator.dispose(buf);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ProjectStructureProblemsHolderImpl.java

示例8: AntMessage

import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
public AntMessage(AntBuildMessageView.MessageType type, int priority, String[] lines, VirtualFile file, int line, int column) {
  myType = type;
  myPriority = priority;
  myFile = file;
  myLine = line;
  myColumn = column;
  myTextLines = lines;
  final StringBuilder builder = StringBuilderSpinAllocator.alloc();
  try {
    for (final String aLine : lines) {
      builder.append(aLine);
      builder.append('\n');
    }
    myText = builder.toString();
  }
  finally {
    StringBuilderSpinAllocator.dispose(builder);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:AntMessage.java

示例9: getActionId

import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
public String getActionId() {
  final String modelName = myBuildFile.getModel().getName();
  if (modelName == null || modelName.length() == 0) {
    return null;
  }
  final StringBuilder builder = StringBuilderSpinAllocator.alloc();
  try {
    builder.append(AntConfiguration.getActionIdPrefix(myBuildFile.getProject()));
    builder.append("_");
    builder.append(modelName);
    builder.append('_');
    builder.append(getName());
    return builder.toString();
  }
  finally {
    StringBuilderSpinAllocator.dispose(builder);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:MetaTarget.java

示例10: getDisplayName

import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
public String getDisplayName() {
  if (!isValid()) {
    return DebuggerBundle.message("status.breakpoint.invalid");
  }
  final StringBuilder buffer = StringBuilderSpinAllocator.alloc();
  try {
    buffer.append(myClassPattern);
    buffer.append(".");
    buffer.append(myMethodName);
    buffer.append("()");
    return buffer.toString();
  }
  finally {
    StringBuilderSpinAllocator.dispose(buffer);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:WildcardMethodBreakpoint.java

示例11: getCustomLabel

import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
private String getCustomLabel(String label) {
  //translate only strings in quotes
  final StringBuilder buf = StringBuilderSpinAllocator.alloc();
  try {
    final Value value = getValue();
    if(isShowIdLabel() && value instanceof ObjectReference) {
      final String idLabel = getIdLabel((ObjectReference)value);
      if(!label.startsWith(idLabel)) {
        buf.append(idLabel);
      }
    }
    if(label == null) {
      //noinspection HardCodedStringLiteral
      buf.append("null");
    }
    else {
      buf.append(label);
    }
    return buf.toString();
  }
  finally {
    StringBuilderSpinAllocator.dispose(buf);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:ValueDescriptorImpl.java

示例12: toDecodedForm

import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
@Override
public String toDecodedForm(boolean skipQueryAndFragment) {
  StringBuilder builder = StringBuilderSpinAllocator.alloc();
  try {
    builder.append(scheme).append("://");
    if (authority != null) {
      builder.append(authority);
    }
    if (path != null) {
      builder.append(getPath());
    }
    if (!skipQueryAndFragment && parameters != null) {
      builder.append(parameters);
    }
    return builder.toString();
  }
  finally {
    StringBuilderSpinAllocator.dispose(builder);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:UrlImpl.java

示例13: launchProcess

import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
@NotNull
public Process launchProcess(@NotNull final ModuleChunk chunk, @NotNull final String outputDir, @NotNull final CompileContext compileContext) throws IOException {
  final String[] commands = createStartupCommand(chunk, compileContext, outputDir);

  if (LOG.isDebugEnabled()) {
    @NonNls final StringBuilder buf = StringBuilderSpinAllocator.alloc();
    try {
      buf.append("\n===================================Environment:===========================\n");
      for (String pair : EnvironmentUtil.getEnvironment()) {
        buf.append("\t").append(pair).append("\n");
      }
      buf.append("=============================================================================\n");
      buf.append("Running compiler: ");
      for (final String command : commands) {
        buf.append(" ").append(command);
      }

      LOG.debug(buf.toString());
    }
    finally {
      StringBuilderSpinAllocator.dispose(buf);
    }
  }

  return Runtime.getRuntime().exec(commands);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:27,代码来源:ExternalCompiler.java

示例14: getPathStringFrom

import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
@NotNull
public String getPathStringFrom(String separator, @Nullable CompositePackagingElement<?> ancestor) {
  final StringBuilder builder = StringBuilderSpinAllocator.alloc();
  try {
    final List<CompositePackagingElement<?>> parents = getParentsFrom(ancestor);
    for (int i = parents.size() - 1; i >= 0; i--) {
      builder.append(parents.get(i).getName());
      if (i > 0) {
        builder.append(separator);
      }
    }
    return builder.toString();
  }
  finally {
    StringBuilderSpinAllocator.dispose(builder);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:PackagingElementPath.java

示例15: getActionId

import com.intellij.util.StringBuilderSpinAllocator; //导入方法依赖的package包/类
@Nullable
public String getActionId() {
  final String modelName = myModel.getName();
  if (modelName == null || modelName.length() == 0) {
    return null;
  }
  final StringBuilder name = StringBuilderSpinAllocator.alloc();
  try {
    name.append(AntConfiguration.getActionIdPrefix(myModel.getBuildFile().getProject()));
    name.append("_");
    name.append(modelName);
    name.append('_');
    name.append(getName());
    return name.toString();
  }
  finally {
    StringBuilderSpinAllocator.dispose(name);
  }
}
 
开发者ID:consulo,项目名称:consulo-apache-ant,代码行数:20,代码来源:AntBuildTargetImpl.java


注:本文中的com.intellij.util.StringBuilderSpinAllocator.alloc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。