- Timestamp:
- 11/26/15 12:45:26 (8 years ago)
- Location:
- SRUServer/trunk/src/main/java/eu/clarin/sru/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
SRUServer/trunk/src/main/java/eu/clarin/sru/server/SRURequest.java
r6821 r6851 105 105 * <em>searchRetrieve</em> requests. 106 106 * 107 * @return the parsed query as an AST or <code>null</code> if not a108 * < em>searchRetrieve</em> request107 * @return an {@link SRUQuery} instance tailored for the used queryType or 108 * <code>null</code> if not a <em>searchRetrieve</em> request 109 109 */ 110 110 public SRUQuery<?> getQuery(); 111 112 113 /** 114 * Get the <em>query</em> parameter of this request. Only available for 115 * <em>searchRetrieve</em> requests. This convenience method tried to cast 116 * the query object to the supplied type. 117 * 118 * @param type 119 * Class representing the Java data type to convert the query to. 120 * @return an {@link SRUQuery} instance tailored for the used queryType or 121 * <code>null</code> if not a <em>searchRetrieve</em> request 122 * @throws ClassCastException 123 * if conversion is not supported, type is <code>null</code> or 124 * another error occurs 125 */ 126 public <T extends SRUQuery<?>> T getQuery(Class<T> type); 111 127 112 128 -
SRUServer/trunk/src/main/java/eu/clarin/sru/server/SRURequestImpl.java
r6842 r6851 815 815 816 816 @Override 817 public <T extends SRUQuery<?>> T getQuery(Class<T> type) { 818 if (type == null) { 819 throw new ClassCastException("type == null"); 820 } 821 // cast() is null-safe 822 return type.cast(query); 823 } 824 825 826 @Override 817 827 public boolean isQueryType(String queryType) { 818 828 if ((queryType != null) && (query != null)) {
Note: See TracChangeset
for help on using the changeset viewer.