本文整理汇总了Java中net.sf.jasperreports.engine.JRQueryChunk类的典型用法代码示例。如果您正苦于以下问题:Java JRQueryChunk类的具体用法?Java JRQueryChunk怎么用?Java JRQueryChunk使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JRQueryChunk类属于net.sf.jasperreports.engine包,在下文中一共展示了JRQueryChunk类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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);
}
}
示例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();
}
示例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();
}
}
}
示例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;
}
示例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;
}
}
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
示例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();
}
}
}
示例14: getChunks
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
@Override
public JRQueryChunk[] getChunks()
{
return this.chunks;
}
示例15: getTokenSeparators
import net.sf.jasperreports.engine.JRQueryChunk; //导入依赖的package包/类
protected String getTokenSeparators()
{
return JRPropertiesUtil.getInstance(DefaultJasperReportsContext.getInstance()).getProperty(JRQueryChunk.PROPERTY_CHUNK_TOKEN_SEPARATOR);
}