1 package org.exoplatform.services.xml.querying.impl.xtas; 2 3 import java.util.HashMap ; 4 5 9 public class QueryType { 10 11 public final static String UPDATE = "update"; 12 public final static String SELECT = "select"; 13 public final static String DELETE = "delete"; 14 public final static String APPEND = "append"; 15 public final static String CREATE = "create"; 16 public final static String DROP = "drop"; 17 private final static String XML = "xml"; 18 private final static String RESOURCE = "resource"; 19 private String type; 20 private static HashMap types = new HashMap (); 21 22 static { 23 24 types.put( UPDATE, XML ); 25 types.put( SELECT, XML ); 26 types.put( DELETE, XML ); 27 types.put( APPEND, XML ); 28 types.put( DROP, RESOURCE ); 29 types.put( CREATE, RESOURCE ); 30 31 } 32 33 public static String [] getAll() 34 { 35 String s[]= {SELECT, UPDATE, DELETE, APPEND, CREATE, DROP}; 36 return s; 37 } 38 39 public static boolean isAtResource( String type ) 40 { 41 return types.get( type ).equals( RESOURCE ); 42 } 43 44 public static boolean isAtXml( String type ) 45 { 46 return types.get( type ).equals( XML ); 47 } 48 49 public static boolean exists( String type ) 50 { 51 return types.get( type ) != null; 52 } 53 } 54 | Popular Tags |