本文整理汇总了Java中net.sf.jasperreports.engine.JRQueryChunk类的典型用法代码示例。如果您正苦于以下问题:Java JRQueryChunk类的具体用法?Java JRQueryChunk怎么用?Java JRQueryChunk使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JRQueryChunk类属于net.sf.jasperreports.engine包,在下文中一共展示了JRQueryChunk类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getQueryChunk
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
/**
*
*/
protected JRBaseQueryChunk getQueryChunk(JRQueryChunk queryChunk)
{
JRBaseQueryChunk baseQueryChunk = null;
if (queryChunk != null)
{
baseQueryChunk = (JRBaseQueryChunk)get(queryChunk);
if (baseQueryChunk == null)
{
baseQueryChunk = new JRBaseQueryChunk(queryChunk, this);
}
}
return baseQueryChunk;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:19,代码来源:JRBaseObjectFactory.java
示例2: JRBaseQueryChunk
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
/**
*
*/
protected JRBaseQueryChunk(JRQueryChunk queryChunk, JRBaseObjectFactory factory)
{
factory.put(queryChunk, this);
type = queryChunk.getType();
text = queryChunk.getText();
tokenSeparator = queryChunk.getTokenSeparator();
String[] chunkTokens = queryChunk.getTokens();
if (chunkTokens == null)
{
tokens = null;
}
else
{
tokens = new String[chunkTokens.length];
System.arraycopy(chunkTokens, 0, tokens, 0, chunkTokens.length);
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:23,代码来源:JRBaseQueryChunk.java
示例3: JRBaseQuery
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
/**
*
*/
protected JRBaseQuery(JRQuery query, JRBaseObjectFactory factory)
{
factory.put(query, this);
/* */
JRQueryChunk[] jrChunks = query.getChunks();
if (jrChunks != null && jrChunks.length > 0)
{
chunks = new JRQueryChunk[jrChunks.length];
for(int i = 0; i < chunks.length; i++)
{
chunks[i] = factory.getQueryChunk(jrChunks[i]);
}
}
language = query.getLanguage();
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:21,代码来源:JRBaseQuery.java
示例4: parseQuery
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
/**
* Parses the query and replaces the parameter clauses by the parameter values and
* the parameters by the return value of {@link #getParameterReplacement(String) getParameterReplacement}.
*
*/
protected void parseQuery()
{
parameterClauseStack = new HashSet<String>();
JRQuery query = dataset.getQuery();
if (query != null)
{
JRQueryChunk[] chunks = query.getChunks();
if (chunks != null && chunks.length > 0)
{
StringBuffer sbuffer = new StringBuffer();
for(int i = 0; i < chunks.length; i++)
{
JRQueryChunk chunk = chunks[i];
appendQueryChunk(sbuffer, chunk);
}
queryString = sbuffer.toString();
}
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:28,代码来源:JRAbstractQueryExecuter.java
示例5: getQuery
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
public JRQuery getQuery() {
JRQuery query = new JRBaseQuery() {
/**
*
*/
private static final long serialVersionUID = 1L;
public JRQueryChunk[] getChunks() {
return null;
}
public String getLanguage() {
return "resourceQuery";
}
public String getText() {
return getQueryText();
}
};
return query;
}
开发者ID:qoswork,项目名称:opennmszh,代码行数:23,代码来源:ResourceQueryFieldsProviderTest.java
示例6: appendQueryChunk
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
protected void appendQueryChunk(StringBuffer sbuffer, JRQueryChunk chunk)
{
switch (chunk.getType())
{
case JRQueryChunk.TYPE_PARAMETER_CLAUSE :
{
appendParameterClauseChunk(sbuffer, chunk.getText());
break;
}
case JRQueryChunk.TYPE_PARAMETER :
{
appendParameterChunk(sbuffer, chunk.getText());
break;
}
case JRQueryChunk.TYPE_CLAUSE_TOKENS :
{
appendClauseChunk(sbuffer, chunk.getTokens());
break;
}
case JRQueryChunk.TYPE_TEXT :
default :
{
appendTextChunk(sbuffer, chunk.getText());
break;
}
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:28,代码来源:JRAbstractQueryExecuter.java
示例7: getChunks
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
@Override
public JRQueryChunk[] getChunks()
{
JRQueryChunk[] chunkArray = null;
if (chunks != null && chunks.size() > 0)
{
chunkArray = new JRQueryChunk[chunks.size()];
chunks.toArray(chunkArray);
}
return chunkArray;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:14,代码来源:JRDesignQuery.java
示例8: addTextChunk
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
/**
*
*/
public void addTextChunk(String text)
{
JRDesignQueryChunk chunk = new JRDesignQueryChunk();
chunk.setType(JRQueryChunk.TYPE_TEXT);
chunk.setText(text);
this.chunks.add(chunk);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:12,代码来源:JRDesignQuery.java
示例9: addParameterChunk
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
/**
*
*/
public void addParameterChunk(String text)
{
JRDesignQueryChunk chunk = new JRDesignQueryChunk();
chunk.setType(JRQueryChunk.TYPE_PARAMETER);
chunk.setText(text);
this.chunks.add(chunk);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:12,代码来源:JRDesignQuery.java
示例10: addParameterClauseChunk
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
/**
*
*/
public void addParameterClauseChunk(String text)
{
JRDesignQueryChunk chunk = new JRDesignQueryChunk();
chunk.setType(JRQueryChunk.TYPE_PARAMETER_CLAUSE);
chunk.setText(text);
this.chunks.add(chunk);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:12,代码来源:JRDesignQuery.java
示例11: addClauseChunk
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
/**
* Adds a {@link JRQueryChunk#TYPE_CLAUSE_TOKENS clause chunk} to the query.
*
* @param tokens the clause tokens
* @see JRDesignQueryChunk#setTokens(String[])
* @deprecated Replaced by {@link #addClauseChunk(String[], char)}.
*/
public void addClauseChunk(String[] tokens)
{
JRDesignQueryChunk chunk = new JRDesignQueryChunk();
chunk.setType(JRQueryChunk.TYPE_CLAUSE_TOKENS);
chunk.setTokens(tokens);
this.chunks.add(chunk);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:16,代码来源:JRDesignQuery.java
示例12: setText
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
/**
*
*/
public void setText(String text)
{
Object old = getText();
chunks = new ArrayList<JRQueryChunk>();
JRQueryParser.instance().parse(text, chunkAdder());
getEventSupport().firePropertyChange(PROPERTY_TEXT, old, getText());
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:11,代码来源:JRDesignQuery.java
示例13: parseQuery
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
/**
*
*/
private void parseQuery() {
queryString = "";
parameterNames = new ArrayList();
if( query != null ) {
JRQueryChunk[] chunks = query.getChunks();
if( chunks != null && chunks.length > 0 ) {
StringBuffer sbuffer = new StringBuffer();
JRQueryChunk chunk = null;
for( int i = 0; i < chunks.length; i++ ) {
chunk = chunks[i];
switch( chunk.getType() ) {
case JRQueryChunk.TYPE_PARAMETER_CLAUSE: {
String parameterName = chunk.getText();
Object parameterValue = parameterValues.get( parameterName );
sbuffer.append( String.valueOf( parameterValue ) );
// parameterNames.add(parameterName);
break;
}
case JRQueryChunk.TYPE_PARAMETER: {
sbuffer.append( "?" );
parameterNames.add( chunk.getText() );
break;
}
case JRQueryChunk.TYPE_TEXT:
default: {
sbuffer.append( chunk.getText() );
break;
}
}
}
queryString = sbuffer.toString();
}
}
}
开发者ID:mtpettyp,项目名称:openreports,代码行数:40,代码来源:JRQueryExecuter.java
示例14: getChunks
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
@Override
public JRQueryChunk[] getChunks()
{
return this.chunks;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:6,代码来源:JRBaseQuery.java
示例15: getTokenSeparators
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
protected String getTokenSeparators()
{
return JRPropertiesUtil.getInstance(DefaultJasperReportsContext.getInstance()).getProperty(JRQueryChunk.PROPERTY_CHUNK_TOKEN_SEPARATOR);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:5,代码来源:JRQueryParser.java
示例16: asText
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
/**
* (Re)creates the query text from a list of chunks.
*
* @param chunks the chunks
* @return the recreated query text
*/
public String asText(JRQueryChunk[] chunks)
{
String text = "";
if (chunks != null && chunks.length > 0)
{
StringBuilder sb = new StringBuilder();
for(int i = 0; i < chunks.length; i++)
{
JRQueryChunk queryChunk = chunks[i];
switch(queryChunk.getType())
{
case JRQueryChunk.TYPE_PARAMETER :
{
sb.append("$P{");
sb.append( queryChunk.getText() );
sb.append("}");
break;
}
case JRQueryChunk.TYPE_PARAMETER_CLAUSE :
{
sb.append("$P!{");
sb.append( queryChunk.getText() );
sb.append("}");
break;
}
case JRQueryChunk.TYPE_CLAUSE_TOKENS :
{
sb.append("$X{");
sb.append(queryChunk.getText());
sb.append("}");
break;
}
case JRQueryChunk.TYPE_TEXT :
default :
{
sb.append( queryChunk.getText() );
break;
}
}
}
text = sb.toString();
}
return text;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:55,代码来源:JRQueryParser.java
示例17: verifyQuery
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
/**
*
*/
private void verifyQuery(JRDesignDataset dataset)
{
JRQuery query = dataset.getQuery();
if (query != null)
{
String language = query.getLanguage();
QueryExecuterFactory queryExecuterFactory = null;
if (language == null || language.length() == 0)
{
addBrokenRule("Query language not set.", query);
}
else
{
try
{
queryExecuterFactory = JRQueryExecuterUtils.getInstance(jasperReportsContext).getExecuterFactory(query.getLanguage());
}
catch (JRException e1)
{
addBrokenRule("Query executer factory for " + language + " cannot be created.", query);
}
}
JRQueryChunk[] chunks = query.getChunks();
if (chunks != null && chunks.length > 0)
{
Map<String, JRParameter> parametersMap = dataset.getParametersMap();
for(int j = 0; j < chunks.length; j++)
{
JRQueryChunk queryChunk = chunks[j];
switch (queryChunk.getType())
{
case JRQueryChunk.TYPE_PARAMETER :
{
JRParameter parameter = parametersMap.get(queryChunk.getText());
if ( parameter == null )
{
addBrokenRule("Query parameter not found : " + queryChunk.getText(), query);
}
else if (queryExecuterFactory != null)
{
String parameterType = null;
try
{
parameterType = parameter.getValueClassName();
}
catch (JRRuntimeException e)
{
// ignore, already added when the parameter got verified
}
if (parameterType != null && !queryExecuterFactory.supportsQueryParameterType(parameterType))
{
addBrokenRule("Parameter type not supported in query : " + queryChunk.getText() + " class " + parameterType, query);
}
}
break;
}
case JRQueryChunk.TYPE_PARAMETER_CLAUSE :
{
if (!parametersMap.containsKey(queryChunk.getText()))
{
addBrokenRule("Query parameter not found : " + queryChunk.getText(), query);
}
break;
}
case JRQueryChunk.TYPE_TEXT :
default :
{
}
}
}
}
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:81,代码来源:JRVerifier.java
示例18: setChunks
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
/**
*
*/
public void setChunks(List<JRQueryChunk> chunks)
{
this.chunks = chunks;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:8,代码来源:JRDesignQuery.java
示例19: cascadingDependencies
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
private void cascadingDependencies(ResourceDescriptor ic, Set<String> icNames) {
List<ResourceDescriptor> children = ic.getChildren();
for (ResourceDescriptor sub_ic : children) {
if (!InputControlsManager.isRDQuery(sub_ic))
continue;
String queryString = sub_ic.getSql();
String lang = sub_ic.getResourceProperty(ResourceDescriptor.PROP_QUERY_LANGUAGE).getValue();
if (!Misc.isNullOrEmpty(queryString)) {
List<String> parameters = new ArrayList<String>();
JRDesignQuery query = new JRDesignQuery();
query.setText(queryString);
if (lang != null)
query.setLanguage(lang);
for (JRQueryChunk chunk : query.getChunks()) {
switch (chunk.getType()) {
case JRQueryChunk.TYPE_TEXT:
break;
case JRQueryChunk.TYPE_PARAMETER_CLAUSE:
case JRQueryChunk.TYPE_PARAMETER:
String paramName = chunk.getText().trim();
if (!parameters.contains(paramName) && icNames.contains(paramName))
parameters.add(paramName);
break;
case JRQueryChunk.TYPE_CLAUSE_TOKENS:
String[] tokens = chunk.getTokens();
if (tokens.length > 2) {
for (String t : tokens) {
t = t.trim();
if (!parameters.contains(t) && icNames.contains(t))
parameters.add(t);
}
}
break;
}
}
if (!parameters.isEmpty())
ic.setMasterInputControls(parameters);
}
break;
}
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:42,代码来源:SoapConnection.java
注:本文中的net.sf.jasperreports.engine.JRQueryChunk类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论