gpt4 book ai didi

org.apache.commons.jelly.parser.XMLParser.setContext()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-25 13:37:05 27 4
gpt4 key购买 nike

本文整理了Java中org.apache.commons.jelly.parser.XMLParser.setContext()方法的一些代码示例,展示了XMLParser.setContext()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLParser.setContext()方法的具体详情如下:
包路径:org.apache.commons.jelly.parser.XMLParser
类名称:XMLParser
方法名:setContext

XMLParser.setContext介绍

暂无

代码示例

代码示例来源:origin: commons-jelly/commons-jelly

/**
   * Factory method to create a new Jelly parser
   * @return XMLParser
   */
  protected XMLParser createJellyParser() {
    XMLParser answer = new XMLParser();
    answer.setContext(context);
    return answer;
  }
}

代码示例来源:origin: org.hudsonci.stapler/commons-jelly

/**
   * Factory method to create a new Jelly parser
   * @return XMLParser
   */
  protected XMLParser createJellyParser() {
    XMLParser answer = new XMLParser();
    answer.setContext(context);
    return answer;
  }
}

代码示例来源:origin: org.jenkins-ci/commons-jelly

/**
   * Factory method to create a new Jelly parser
   * @return XMLParser
   */
  protected XMLParser createJellyParser() {
    XMLParser answer = new XMLParser();
    answer.setContext(context);
    return answer;
  }
}

代码示例来源:origin: org.jvnet.hudson/commons-jelly

/**
   * Factory method to create a new Jelly parser
   * @return XMLParser
   */
  protected XMLParser createJellyParser() {
    XMLParser answer = new XMLParser();
    answer.setContext(context);
    return answer;
  }
}

代码示例来源:origin: org.hudsonci.stapler/commons-jelly

/**
 * Attempts to parse the script from the given InputSource using the
 * {@link #getResource} method then returns the compiled script.
 */
public Script compileScript(InputSource source) throws JellyException {
  XMLParser parser = getXMLParser();
  parser.setContext(this);
  Script script = null;
  try {
    script = parser.parse(source);
  } catch (IOException e) {
    throw new JellyException(JellyContext.BAD_PARSE+" : "+source.getSystemId(), e);
  } catch (SAXException e) {
    throw new JellyException(JellyContext.BAD_PARSE+" : "+source.getSystemId(), e);
  }
  return script.compile();
}

代码示例来源:origin: commons-jelly/commons-jelly

/**
 * Compile the script
 */
private void compileScriptAndKeep() {
  XMLParser parser = new XMLParser();
  parser.setContext(m_context);
  m_scriptCompiled = false;
  try {
    m_script = parser.parse(m_inputStream);
    m_script = m_script.compile();
    m_scriptCompiled = true;
  }
  catch (IOException e) {
    m_scriptCompilationException = e;
  }
  catch (SAXException e) {
    m_scriptCompilationException = e;
  }
  catch (Exception e) {
    m_scriptCompilationException = e;
  }
}

代码示例来源:origin: org.jvnet.hudson/commons-jelly

/**
 * Attempts to parse the script from the given InputSource using the
 * {@link #getResource} method then returns the compiled script.
 */
public Script compileScript(InputSource source) throws JellyException {
  XMLParser parser = getXMLParser();
  parser.setContext(this);
  Script script = null;
  try {
    script = parser.parse(source);
  } catch (IOException e) {
    throw new JellyException(JellyContext.BAD_PARSE+" : "+source.getSystemId(), e);
  } catch (SAXException e) {
    throw new JellyException(JellyContext.BAD_PARSE+" : "+source.getSystemId(), e);
  }
  return script.compile();
}

代码示例来源:origin: org.jenkins-ci/commons-jelly

/**
 * Attempts to parse the script from the given InputSource using the
 * {@link #getResource} method then returns the compiled script.
 */
public Script compileScript(InputSource source) throws JellyException {
  XMLParser parser = getXMLParser();
  parser.setContext(this);
  Script script = null;
  try {
    script = parser.parse(source);
  } catch (IOException e) {
    throw new JellyException(JellyContext.BAD_PARSE+" : "+source.getSystemId(), e);
  } catch (SAXException e) {
    throw new JellyException(JellyContext.BAD_PARSE+" : "+source.getSystemId(), e);
  }
  return script.compile();
}

代码示例来源:origin: org.jenkins-ci/commons-jelly

/**
 * Compile the script
 */
private void compileScriptAndKeep() {
  XMLParser parser = new XMLParser();
  parser.setContext(m_context);
  m_scriptCompiled = false;
  try {
    m_script = parser.parse(m_inputStream);
    m_script = m_script.compile();
    m_scriptCompiled = true;
  }
  catch (IOException e) {
    m_scriptCompilationException = e;
  }
  catch (SAXException e) {
    m_scriptCompilationException = e;
  }
  catch (Exception e) {
    m_scriptCompilationException = e;
  }
}

代码示例来源:origin: org.hudsonci.stapler/commons-jelly

/**
 * Compile the script
 */
private void compileScriptAndKeep() {
  XMLParser parser = new XMLParser();
  parser.setContext(m_context);
  m_scriptCompiled = false;
  try {
    m_script = parser.parse(m_inputStream);
    m_script = m_script.compile();
    m_scriptCompiled = true;
  }
  catch (IOException e) {
    m_scriptCompilationException = e;
  }
  catch (SAXException e) {
    m_scriptCompilationException = e;
  }
  catch (Exception e) {
    m_scriptCompilationException = e;
  }
}

代码示例来源:origin: org.jvnet.hudson/commons-jelly

/**
 * Compile the script
 */
private void compileScriptAndKeep() {
  XMLParser parser = new XMLParser();
  parser.setContext(m_context);
  m_scriptCompiled = false;
  try {
    m_script = parser.parse(m_inputStream);
    m_script = m_script.compile();
    m_scriptCompiled = true;
  }
  catch (IOException e) {
    m_scriptCompilationException = e;
  }
  catch (SAXException e) {
    m_scriptCompilationException = e;
  }
  catch (Exception e) {
    m_scriptCompilationException = e;
  }
}

代码示例来源:origin: org.jenkins-ci/commons-jelly

/**
 * Attempts to parse the script from the given URL using the
 * {@link #getResource} method then returns the compiled script.
 */
public Script compileScript(URL url) throws JellyException {
  XMLParser parser = getXMLParser();
  parser.setContext(this);
  Script script;
  try {
    script = parser.parse(url.toString());
  } catch (IOException e) {
    throw new JellyException(JellyContext.BAD_PARSE+" : "+url, e);
  } catch (SAXException e) {
    throw new JellyException(JellyContext.BAD_PARSE+" : "+url, e);
  }
  return script.compile();
}

代码示例来源:origin: commons-jelly/commons-jelly

/**
 * Attempts to parse the script from the given URL using the
 * {@link #getResource} method then returns the compiled script.
 */
public Script compileScript(URL url) throws JellyException {
  XMLParser parser = getXMLParser();
  parser.setContext(this);
  Script script = null;
  try {
    script = parser.parse(url.toString());
  } catch (IOException e) {
    throw new JellyException(JellyContext.BAD_PARSE, e);
  } catch (SAXException e) {
    throw new JellyException(JellyContext.BAD_PARSE, e);
  }
  return script.compile();
}

代码示例来源:origin: org.jvnet.hudson/commons-jelly

/**
 * Attempts to parse the script from the given URL using the
 * {@link #getResource} method then returns the compiled script.
 */
public Script compileScript(URL url) throws JellyException {
  XMLParser parser = getXMLParser();
  parser.setContext(this);
  Script script;
  try {
    script = parser.parse(url.toString());
  } catch (IOException e) {
    throw new JellyException(JellyContext.BAD_PARSE+" : "+url, e);
  } catch (SAXException e) {
    throw new JellyException(JellyContext.BAD_PARSE+" : "+url, e);
  }
  return script.compile();
}

代码示例来源:origin: org.hudsonci.stapler/commons-jelly

/**
 * Attempts to parse the script from the given URL using the
 * {@link #getResource} method then returns the compiled script.
 */
public Script compileScript(URL url) throws JellyException {
  XMLParser parser = getXMLParser();
  parser.setContext(this);
  Script script;
  try {
    script = parser.parse(url.toString());
  } catch (IOException e) {
    throw new JellyException(JellyContext.BAD_PARSE+" : "+url, e);
  } catch (SAXException e) {
    throw new JellyException(JellyContext.BAD_PARSE+" : "+url, e);
  }
  return script.compile();
}

代码示例来源:origin: commons-jelly/commons-jelly

/**
 * Attempts to parse the script from the given InputSource using the
 * {@link #getResource} method then returns the compiled script.
 */
public Script compileScript(InputSource source) throws JellyException {
  XMLParser parser = getXMLParser();
  parser.setContext(this);
  Script script = null;
  try {
    script = parser.parse(source);
  } catch (IOException e) {
    throw new JellyException(JellyContext.BAD_PARSE, e);
  } catch (SAXException e) {
    throw new JellyException(JellyContext.BAD_PARSE, e);
  }
  return script.compile();
}

代码示例来源:origin: commons-jelly/commons-jelly

/**
 * Attempts to parse the script from the given uri using the
 * {@link #getResource} method then returns the compiled script.
 */
public Script compileScript(String uri) throws JellyException {
  XMLParser parser = getXMLParser();
  parser.setContext(this);
  InputStream in = getResourceAsStream(uri);
  if (in == null) {
    throw new JellyException("Could not find Jelly script: " + uri);
  }
  Script script = null;
  try {
    script = parser.parse(in);
  } catch (IOException e) {
    throw new JellyException(JellyContext.BAD_PARSE, e);
  } catch (SAXException e) {
    throw new JellyException(JellyContext.BAD_PARSE, e);
  }
  return script.compile();
}

代码示例来源:origin: org.jenkins-ci/commons-jelly

/**
 * Attempts to parse the script from the given uri using the
 * {@link #getResource} method then returns the compiled script.
 */
public Script compileScript(String uri) throws JellyException {
  XMLParser parser = getXMLParser();
  parser.setContext(this);
  InputStream in = getResourceAsStream(uri);
  if (in == null) {
    throw new JellyException("Could not find Jelly script: " + uri);
  }
  Script script = null;
  try {
    script = parser.parse(in);
  } catch (IOException e) {
    throw new JellyException(JellyContext.BAD_PARSE+" : "+uri, e);
  } catch (SAXException e) {
    throw new JellyException(JellyContext.BAD_PARSE+" : "+uri, e);
  }
  return script.compile();
}

代码示例来源:origin: org.jvnet.hudson/commons-jelly

/**
 * Attempts to parse the script from the given uri using the
 * {@link #getResource} method then returns the compiled script.
 */
public Script compileScript(String uri) throws JellyException {
  XMLParser parser = getXMLParser();
  parser.setContext(this);
  InputStream in = getResourceAsStream(uri);
  if (in == null) {
    throw new JellyException("Could not find Jelly script: " + uri);
  }
  Script script = null;
  try {
    script = parser.parse(in);
  } catch (IOException e) {
    throw new JellyException(JellyContext.BAD_PARSE+" : "+uri, e);
  } catch (SAXException e) {
    throw new JellyException(JellyContext.BAD_PARSE+" : "+uri, e);
  }
  return script.compile();
}

代码示例来源:origin: org.hudsonci.stapler/commons-jelly

/**
 * Attempts to parse the script from the given uri using the
 * {@link #getResource} method then returns the compiled script.
 */
public Script compileScript(String uri) throws JellyException {
  XMLParser parser = getXMLParser();
  parser.setContext(this);
  InputStream in = getResourceAsStream(uri);
  if (in == null) {
    throw new JellyException("Could not find Jelly script: " + uri);
  }
  Script script = null;
  try {
    script = parser.parse(in);
  } catch (IOException e) {
    throw new JellyException(JellyContext.BAD_PARSE+" : "+uri, e);
  } catch (SAXException e) {
    throw new JellyException(JellyContext.BAD_PARSE+" : "+uri, e);
  }
  return script.compile();
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com