View Javadoc
1 /* 2 * $Header: /cvsroot/ebxmlrr/ebxmlrr/src/share/com/sun/ebxml/registry/query/filter/InternationalStringBranchProcessor.java,v 1.5 2002/03/06 04:40:40 nstojano Exp $ 3 */ 4 5 package com.sun.ebxml.registry.query.filter; 6 7 import com.sun.ebxml.registry.*; 8 9 import org.oasis.ebxml.registry.bindings.query.*; 10 import org.oasis.ebxml.registry.bindings.rs.*; 11 12 /*** 13 * Class Declaration for InternationalStringBranchProcessor 14 * @see 15 * @author Nikola Stojanovic 16 */ 17 public class InternationalStringBranchProcessor extends BranchProcessor { 18 19 private NameBranch nameBranch = null; 20 private DescriptionBranch descriptionBranch = null; 21 22 23 protected String getName() { 24 25 if (nameBranch != null) { 26 return "Name"; 27 } 28 else if (descriptionBranch != null) { 29 return "Description"; 30 } 31 else { 32 return ""; 33 } 34 } 35 36 37 protected void setNativeBranch(Object branch) { 38 39 if (branch instanceof org.oasis.ebxml.registry.bindings.query.NameBranch) { 40 nameBranch = (NameBranch)branch; 41 } 42 else if (branch instanceof org.oasis.ebxml.registry.bindings.query.DescriptionBranch) { 43 descriptionBranch = (DescriptionBranch)branch; 44 } 45 } 46 47 48 protected void buildFilterClauses() throws RegistryException { 49 50 convertLocalizedStringFilters(); 51 } 52 53 54 protected void buildQueryClauses() throws RegistryException { 55 } 56 57 58 protected void buildBranchClauses() throws RegistryException { 59 } 60 61 62 private void convertLocalizedStringFilters() throws RegistryException { 63 64 LocalizedStringFilter[] localizedStringFilter = null; 65 66 if (nameBranch != null) { 67 localizedStringFilter = nameBranch.getLocalizedStringFilter(); 68 } 69 else if (descriptionBranch != null){ 70 localizedStringFilter = descriptionBranch.getLocalizedStringFilter(); 71 } 72 73 if (localizedStringFilter.length > 0) { 74 filterProcessor.setSelectColumn("parent"); 75 76 for (int i=0; i<localizedStringFilter.length; i++) { 77 whereClause = filterProcessor.addNativeWhereClause(whereClause, localizedStringFilter[i]); 78 } 79 } 80 } 81 }

This page was automatically generated by Maven