KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > media > entity > query > JBossMediaQueryLanguage


1 package org.jboss.media.entity.query;
2
3 import java.util.Collection JavaDoc;
4 import java.util.Collections JavaDoc;
5 import java.util.Map JavaDoc;
6
7 import javax.ejb.FinderException JavaDoc;
8 import javax.emb.IllegalOptionException;
9 import javax.emb.MediaException;
10
11 import org.jboss.media.entity.MetaDataEntityBean;
12
13 public class JBossMediaQueryLanguage implements MediaQueryLanguage
14 {
15    private static final String JavaDoc NAME = "JBossMediaQueryLanguage";
16
17    private static final Map JavaDoc OPTIONS =
18       Collections.unmodifiableMap(Collections.EMPTY_MAP);
19
20    public JBossMediaQueryLanguage()
21    {
22    }
23
24    public String JavaDoc getName() throws MediaException
25    {
26       return NAME;
27    }
28
29    public Map JavaDoc getOptions() throws MediaException
30    {
31       return Collections.EMPTY_MAP;
32    }
33
34    public void setOptions(Map JavaDoc options) throws MediaException
35    {
36       throw new IllegalOptionException("You can't set options for this query language");
37    }
38
39    public Collection JavaDoc query(MetaDataEntityBean metaDataEntity, String JavaDoc query)
40       throws FinderException JavaDoc, MediaException
41    {
42       return metaDataEntity.ejbSelectByPartialXML(query);
43    }
44 }
Popular Tags