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


Java StringHolder类代码示例

本文整理汇总了Java中org.omg.CORBA.StringHolder的典型用法代码示例。如果您正苦于以下问题:Java StringHolder类的具体用法?Java StringHolder怎么用?Java StringHolder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: parseApplicationHandlerDefinitionSignature

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
public static boolean parseApplicationHandlerDefinitionSignature(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "parseApplicationHandlerDefinitionSignature")) return false;
  boolean r;
  //application handled definition in script only makes sense inside <using terms of> statement
  if (b.getUserData(IS_PARSING_USING_TERMS_FROM_STATEMENT) != Boolean.TRUE || b.getUserData(PARSING_TELL_COMPOUND_STATEMENT) == Boolean.TRUE) return false;

  StringHolder parsedCommandName = new StringHolder();
  String toldApplicationName = getTargetApplicationName(b);
  PsiBuilder.Marker m2 = enter_section_(b, l, _COLLAPSE_, "<parse Application Handler Definition");
  r = parseDictionaryCommandNameInner(b, l + 1, parsedCommandName, toldApplicationName, true, null);
  exit_section_(b, l, m2, DICTIONARY_COMMAND_NAME, r, false, null);

  if (!r) return false;
  // TODO: 06/12/15 may be try to avoid creating PSI here!..
  List<AppleScriptCommand> allCommandsWithName = getAllCommandsWithName(b, parsedCommandName.value, toldApplicationName, false, null);

  for (AppleScriptCommand command : allCommandsWithName) {
    r = parseParametersForCommand(b, l + 1, command);//custom parsing here
    if (r) {
      break;
    }
  }
  boolean incompleteHandlerCall = !r && allCommandsWithName.size() > 0 && (b.getTokenType() == NLS || b.eof());
  return r || incompleteHandlerCall;

}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:27,代码来源:AppleScriptGeneratedParserUtil.java

示例2: parseExpression

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
/**
   * If inside tell (only in a tell?) compound statement - first check it's terms
   */
  public static boolean parseExpression(PsiBuilder b, int l, String dictionaryTermToken, Parser expression) {
    if (!recursion_guard_(b, l, "parseExpression")) return false;
    if (!nextTokenIsFast(b, dictionaryTermToken)) return false;
    boolean r;

    //check application terms first
    if (b.getUserData(PARSING_TELL_COMPOUND_STATEMENT) == Boolean.TRUE) {
      String toldAppName = peekTargetApplicationName(b);
      if (!StringUtil.isEmpty(toldAppName)) {
        StringHolder parsedName = new StringHolder();
        PsiBuilder.Marker mComName = enter_section_(b, l, _AND_, "<parse Expression>");
        r = parseCommandNameForApplication(b, l + 1, parsedName, toldAppName, true);
        exit_section_(b, l, mComName, null, r, false, null);
        if (r) return false;
        if (ParsableScriptSuiteRegistryHelper.isPropertyWithPrefixExist(toldAppName, dictionaryTermToken)) {
          return false;
//          PsiBuilder.Marker m = enter_section_(b, l, _AND_, null, "<dictionary constant>");
//          r = parseDictionaryConstant(b, l + 1);
//          exit_section_(b, l, m, r, false, null);
//          if (r) return false;
        }
      }
    }
    return expression.parse(b, l + 1);
  }
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:29,代码来源:AppleScriptGeneratedParserUtil.java

示例3: parseCommandParameterSelector

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
private static boolean parseCommandParameterSelector(PsiBuilder b, int l, AppleScriptCommand command,
                                                     StringHolder parsedParameterSelector) {
  if (!recursion_guard_(b, l, "parseCommandParameterSelector")) return false;
  boolean r = false;
  PsiBuilder.Marker m = enter_section_(b, l, _NONE_, "<parse Command Parameter Selector>");//todo check this _AND_
  parsedParameterSelector.value = b.getTokenText() == null ? "" : b.getTokenText();
  while (!b.eof() && b.getTokenType() != NLS && b.getTokenType() != COMMENT) {
    b.advanceLexer();
    if (command.getParameterByName(parsedParameterSelector.value) != null) {
      r = true;
      break;
    }
    parsedParameterSelector.value += " " + b.getTokenText();
  }
  exit_section_(b, l, m, COMMAND_PARAMETER_SELECTOR, r, false, null);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:18,代码来源:AppleScriptGeneratedParserUtil.java

示例4: parseStdLibCommandName

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
private static boolean parseStdLibCommandName(PsiBuilder b, int l, StringHolder parsedName) {
  if (!recursion_guard_(b, l, "parseStdLibCommandName")) return false;
  boolean r = false;
  parsedName.value = "";
  parsedName.value = b.getTokenText() == null ? "" : b.getTokenText();
  PsiBuilder.Marker m = enter_section_(b);
  boolean commandWithPrefixExists = ParsableScriptSuiteRegistryHelper.isStdCommandWithPrefixExist(parsedName.value);
  String nextTokenText = parsedName.value;
  while (b.getTokenText() != null && commandWithPrefixExists) {
    b.advanceLexer(); //advance lexer in any case
    nextTokenText += " " + b.getTokenText();
    commandWithPrefixExists = ParsableScriptSuiteRegistryHelper.isStdCommandWithPrefixExist(nextTokenText);
    if (commandWithPrefixExists) {
      parsedName.value = nextTokenText;
    } else if (ParsableScriptSuiteRegistryHelper.isStdCommand(parsedName.value)) {
      r = true;
      break;
    }
  }
  exit_section_(b, m, null, r);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:23,代码来源:AppleScriptGeneratedParserUtil.java

示例5: parseDictionaryCommandName

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
public static boolean parseDictionaryCommandName(PsiBuilder b, int l) {
  boolean r;
  if (nextTokenIs(b, NLS)) {
    return false;
  }
  StringHolder parsedCommandName = new StringHolder();
  String toldApplicationName = getTargetApplicationName(b);
  boolean areThereUseStatements = b.getUserData(WAS_USE_STATEMENT_USED) == Boolean.TRUE;
  Set<String> applicationsToImport = null;
  if (areThereUseStatements) {
    applicationsToImport = b.getUserData(USED_APPLICATION_NAMES);
  }
  PsiBuilder.Marker m = enter_section_(b, l, _COLLAPSE_, "<parse ApplicationDictionary Command Name>");
  r = parseDictionaryCommandNameInner(b, l + 1, parsedCommandName, toldApplicationName, areThereUseStatements, applicationsToImport);
  exit_section_(b, l, m, DICTIONARY_COMMAND_NAME, r, false, null);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:18,代码来源:AppleScriptGeneratedParserUtil.java

示例6: parseDictionaryClassName

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
/**
 * @param b                     {@link PsiBuilder}
 * @param l                     level deep
 * @param isPluralForm          if parsing plural form of a class name
 * @param checkForUseStatements parser rule for the check if there are use statements in the script
 * @return true in case rule matches, false otherwise
 */
public static boolean parseDictionaryClassName(PsiBuilder b, int l, final boolean isPluralForm, @NotNull Parser checkForUseStatements) {
  if (!recursion_guard_(b, l, "parseDictionaryClassName")) return false;
  boolean r;
  final String s = b.getTokenText();
  if (s == null || s.length() == 0 || !AppleScriptNames.isIdentifierStart(s.charAt(0))) return false;
  final String toldApplicationName = getTargetApplicationName(b);
  final boolean areThereUseStatements = checkForUseStatements.parse(b, l + 1);
  Set<String> applicationsToImportFrom = null;
  if (areThereUseStatements) {
    applicationsToImportFrom = b.getUserData(USED_APPLICATION_NAMES);
  }
  final StringHolder currentTokenText = new StringHolder();
  currentTokenText.value = s;
  r = parseDictionaryClassName(b, l + 1, currentTokenText, isPluralForm, toldApplicationName, areThereUseStatements, applicationsToImportFrom);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:24,代码来源:AppleScriptGeneratedParserUtil.java

示例7: tryToParseStdProperty

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
/**
 * @param b {@link PsiBuilder}
 * @param l level deep
 * @return true if parsed token(s) is the property of the scripting additions library
 */
private static boolean tryToParseStdProperty(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "tryToParseStdProperty")) return false;
  boolean r = false;
  PsiBuilder.Marker m = enter_section_(b);
  StringHolder currentTokenText = new StringHolder();
  currentTokenText.value = b.getTokenText() == null ? "" : b.getTokenText();
  boolean propertyWithPrefixExists = ParsableScriptSuiteRegistryHelper
          .isStdPropertyWithPrefixExist(currentTokenText.value);
  String nextTokenText = currentTokenText.value;
  while (b.getTokenText() != null && propertyWithPrefixExists) {
    b.advanceLexer(); //advance lexer in any case
    nextTokenText += " " + b.getTokenText();
    propertyWithPrefixExists = ParsableScriptSuiteRegistryHelper.isStdPropertyWithPrefixExist(nextTokenText);
    if (propertyWithPrefixExists) {
      currentTokenText.value = nextTokenText;
    } else if (ParsableScriptSuiteRegistryHelper.isStdProperty(currentTokenText.value)) {
      r = true;
      break;
    }
  }
  exit_section_(b, m, null, r);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:29,代码来源:AppleScriptGeneratedParserUtil.java

示例8: tryToParseApplicationProperty

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
/**
 * @param b               {@link PsiBuilder}
 * @param l               level deep
 * @param applicationName name of the application
 * @return true if parsed token(s) is the property of the specified application
 */
private static boolean tryToParseApplicationProperty(PsiBuilder b, int l, @NotNull String applicationName) {
  if (!recursion_guard_(b, l, "tryToParseApplicationProperty")) return false;
  boolean r = false;
  PsiBuilder.Marker m = enter_section_(b);
  StringHolder currentTokenText = new StringHolder();
  currentTokenText.value = b.getTokenText() == null ? "" : b.getTokenText();
  boolean propertyWithPrefixExist = ParsableScriptSuiteRegistryHelper.isPropertyWithPrefixExist(applicationName,
          currentTokenText.value);
  //find the longest lexeme
  String nextTokenText = currentTokenText.value;
  while (b.getTokenText() != null && propertyWithPrefixExist) {
    b.advanceLexer(); //advance lexer in any case
    nextTokenText += " " + b.getTokenText();
    propertyWithPrefixExist = ParsableScriptSuiteRegistryHelper.isPropertyWithPrefixExist(applicationName,
            nextTokenText);
    if (propertyWithPrefixExist) {
      currentTokenText.value = nextTokenText;
    } else if (ParsableScriptSuiteRegistryHelper.isApplicationProperty(applicationName, currentTokenText.value)) {
      r = true;
      break;
    }
  }
  exit_section_(b, m, null, r);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:32,代码来源:AppleScriptGeneratedParserUtil.java

示例9: passSimple

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
/**
 * Accept and return parameters, having various types.
 */
public int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
                      StringHolder a_string, DoubleHolder a_double
                     )
{
  System.out.println("SERVER: ***** Test passing multiple parameters");
  System.out.println("SERVER:   Received:");
  System.out.println("SERVER:   octet " + an_octet.value);
  System.out.println("SERVER:   short " + a_short.value);
  System.out.println("SERVER:   string " + a_string.value);

  // Returning incremented values.
  an_octet.value++;
  a_short.value++;

  // OUT parameter, return only.
  a_double.value = 1;
  a_string.value += " [return]";
  return 452572;
}
 
开发者ID:vilie,项目名称:javify,代码行数:23,代码来源:DemoServant.java

示例10: testParameters

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
/**
 * Test passing multiple parameters in both directions.
 */
public void testParameters()
{
  System.out.println("***** Pass multiple parameters.");

  // Holder classes are required to simulate passing
  // "by reference" (modification is returned back to the server).
  ByteHolder a_byte = new ByteHolder((byte) 0);
  ShortHolder a_short = new ShortHolder((short) 3);
  StringHolder a_string = new StringHolder("[string 4]");

  // This is an 'out' parameter; the value must not be passed to servant.
  DoubleHolder a_double = new DoubleHolder(56.789);

  int returned = object.passSimple(a_byte, 2, a_short, a_string, a_double);

  System.out.println("  Returned value " + returned);
  System.out.println("  Returned parameters: ");
  System.out.println("  octet " + a_byte.value);
  System.out.println("  short " + a_short.value);
  System.out.println("  string '" + a_string.value+"'");
  System.out.println("  double " + a_double.value);
}
 
开发者ID:vilie,项目名称:javify,代码行数:26,代码来源:DirectTest.java

示例11: parseDictionaryCommandNameInner

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
/**
 * @param b                        {@link PsiBuilder}
 * @param l                        level deep
 * @param parsedName               holder for parsed command name string
 * @param toldApplicationName      name of the application to which all messages are sent by default (it's
 *                                 terminology is queried first)
 * @param areThereUseStatements    if there are use statements in script
 * @param applicationsToImportFrom list of application names to use for dictionary terms lookup
 * @return true if rule matches, false otherwise
 */
private static boolean parseDictionaryCommandNameInner(PsiBuilder b, int l,
                                                       @NotNull StringHolder parsedName,
                                                       @NotNull String toldApplicationName,
                                                       boolean areThereUseStatements,
                                                       @Nullable Set<String> applicationsToImportFrom) {
  if (!recursion_guard_(b, l, "parseDictionaryCommandNameInner")) return false;
  boolean r;
  parsedName.value = "";
  // TODO: 12/1/2015 could be command with name which does not exist in this target app but in stanradr additions or
  // CocoaStandard dictionary or in use application dictionary. search all here?? to find the longest dictionary term

  //if there are use statements, do not check terms from scripting additions library (they should be explicitly imported in this case)
  boolean checkStdLib = !areThereUseStatements || applicationsToImportFrom == null
          || applicationsToImportFrom.contains(ApplicationDictionary.SCRIPTING_ADDITIONS_LIBRARY);
  ParsableScriptSuiteRegistryHelper.ensureKnownApplicationInitialized(toldApplicationName);
  r = parseCommandNameForApplication(b, l + 1, parsedName, toldApplicationName, checkStdLib);
  if (r) return true;
  if (areThereUseStatements) {
    if (applicationsToImportFrom != null && !applicationsToImportFrom.isEmpty()) {
      for (String appName : applicationsToImportFrom) {
        //in case of SCRIPTING_ADDITIONS 'StandardAdditions' app name is added to app names import list
        ParsableScriptSuiteRegistryHelper.ensureKnownApplicationInitialized(appName);
        r = parseCommandNameForApplication(b, l + 1, parsedName, appName, false);
        if (r) return true;
      }
    }
  }
  if (checkStdLib) {
    r = parseStdLibCommandName(b, l + 1, parsedName);
    if (r) return true;
  }
  // Could be command from Cocoa Standard library which was not yet checked, because applicationName == ScriptingAdditions.
  // The could happen when parsing <using terms from scripting additions> stms
  r = parseCommandNameForApplication(b, l + 1, parsedName, ApplicationDictionary.COCOA_STANDARD_LIBRARY, checkStdLib);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:47,代码来源:AppleScriptGeneratedParserUtil.java

示例12: parseCommandHandlerCallExpression

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
/**
 * <<< COMMAND_HANDLER_CALL >>>
 */
// commandName commandParameters?
public static boolean parseCommandHandlerCallExpression(PsiBuilder b, int l) {
  if (!recursion_guard_(b, l, "parseCommandHandlerCallExpression")) return false;
  boolean r;

  if (nextTokenIs(b, NLS)) return false;
  final String s = b.getTokenText();

  if (s == null || s.length() == 0 || !AppleScriptNames.isIdentifierStart(s.charAt(0))) return false;
  StringHolder parsedCommandName = new StringHolder();
  //get current application name to which messages will be sent in the current block
  String toldApplicationName = getTargetApplicationName(b);
  //if there are <use statements> present in the script
  boolean areThereUseStatements = b.getUserData(WAS_USE_STATEMENT_USED) == Boolean.TRUE;
  Set<String> applicationsToImport = null;
  if (areThereUseStatements) {
    //adding list of application names from use statements
    applicationsToImport = b.getUserData(USED_APPLICATION_NAMES);
  }
  PsiBuilder.Marker m2 = enter_section_(b, l, _COLLAPSE_, "<parse Command Handler Call Expression>");
  // TODO: 19/12/15 need to parse command name together with parameters for each possible application in order to be
  // able to parse the longest possible application name ('open for access' std lib vs 'open' from application dict)
  r = parseDictionaryCommandNameInner(b, l + 1, parsedCommandName, toldApplicationName, areThereUseStatements, applicationsToImport);
  exit_section_(b, l, m2, DICTIONARY_COMMAND_NAME, r, false, null);

  if (!r) return false;
  // TODO: 06/12/15 may be try to avoid creating PSI here!..
  List<AppleScriptCommand> allCommandsWithName = getAllCommandsWithName(b, parsedCommandName.value, toldApplicationName, areThereUseStatements,
          applicationsToImport);

  for (AppleScriptCommand command : allCommandsWithName) {
    r = parseParametersForCommand(b, l + 1, command);
    if (r) {
      break;
    }
  }
  boolean incompleteHandlerCall = !r && allCommandsWithName.size() > 0 && (b.getTokenType() == NLS || b.eof());
  return r || incompleteHandlerCall;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:43,代码来源:AppleScriptGeneratedParserUtil.java

示例13: parseParameterForCommand

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
private static boolean parseParameterForCommand(PsiBuilder b, int l, AppleScriptCommand command,
                                                StringHolder parsedParameterSelector, boolean givenForm, boolean
                                                        first) {
  if (!recursion_guard_(b, l, "parseParameterForCommand")) return false;
  boolean r;
  PsiBuilder.Marker m = enter_section_(b, l, _NONE_, "<parse Parameter For Command>");//todo check here if it works
  r = parseGivenParameter(b, l + 1, command, parsedParameterSelector, givenForm, first);
  //todo and here exit and enter once again if it is true??
  if (!r) r = parseBooleanParameter(b, l + 1, command, parsedParameterSelector);

  exit_section_(b, l, m, COMMAND_PARAMETER, r, false, null);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:14,代码来源:AppleScriptGeneratedParserUtil.java

示例14: parseBooleanParameter

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
private static boolean parseBooleanParameter(PsiBuilder b, int l, AppleScriptCommand command, StringHolder
        parsedParameterSelector) {
  if (!recursion_guard_(b, l, "parseBooleanParameter")) return false;
  boolean r;
  //need to rollback with/without if there is no match
  PsiBuilder.Marker m = enter_section_(b, l, _NONE_, "<parse Boolean Parameter>");
  b.putUserData(PARSING_COMMAND_HANDLER_BOOLEAN_PARAMETER, true);
  r = consumeToken(b, WITH);
  if (!r) r = consumeToken(b, WITHOUT);
  if (!r) r = consumeToken(b, LAND); //for cases like: '...with regexp and all occurrences without case sensitive'
  r = r && parseCommandParameterSelector(b, l + 1, command, parsedParameterSelector);
  exit_section_(b, l, m, null, r, false, null);
  b.putUserData(PARSING_COMMAND_HANDLER_BOOLEAN_PARAMETER, false);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:16,代码来源:AppleScriptGeneratedParserUtil.java

示例15: parseGivenParameter

import org.omg.CORBA.StringHolder; //导入依赖的package包/类
private static boolean parseGivenParameter(PsiBuilder b, int l, AppleScriptCommand command,
                                           StringHolder parsedParameterSelector, boolean givenForm, boolean first) {
  if (!recursion_guard_(b, l, "parseGivenParameter")) return false;
  PsiBuilder.Marker m = enter_section_(b, l, _NONE_, "<parse Given Parameter>");
  boolean r = !givenForm || first || consumeToken(b, COMMA);//if it is a given form and not the first parameter ->
  // should be comma
  r = r && parseCommandParameterSelector(b, l + 1, command, parsedParameterSelector);
  final CommandParameter parameterDefinition = command.getParameterByName(parsedParameterSelector.value);
  //todo: parameter value expression could be incorrectly parsed and needed to be rolled backed (__AND__ modifier?)
  //as in example: mount volume "" in AppleTalk zone ""  (in - parsed as range ref form)
  if (givenForm) r = consumeToken(b, COLON);
  r = r && parseCommandParameterValue(b, l + 1, parameterDefinition);
  exit_section_(b, l, m, null, r, false, null);
  return r;
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:16,代码来源:AppleScriptGeneratedParserUtil.java


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