1 29 30 package com.caucho.config.jaxb; 31 32 import com.caucho.config.*; 33 import com.caucho.config.j2ee.InjectIntrospector; 34 import com.caucho.loader.Environment; 35 import com.caucho.loader.EnvironmentListener; 36 import com.caucho.loader.WeakDestroyListener; 37 import com.caucho.util.L10N; 38 import com.caucho.xml.QName; 39 import com.caucho.xml.QNode; 40 41 import org.w3c.dom.Node ; 42 43 import javax.annotation.PostConstruct; 44 import javax.annotation.PreDestroy; 45 import javax.xml.bind.annotation.*; 46 import javax.xml.bind.annotation.adapters.XmlAdapter; 47 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; 48 import java.beans.Introspector ; 49 import java.lang.annotation.Annotation ; 50 import java.lang.reflect.Field ; 51 import java.lang.reflect.Method ; 52 import java.lang.reflect.Modifier ; 53 import java.lang.reflect.ParameterizedType ; 54 import java.lang.reflect.Type ; 55 import java.util.ArrayList ; 56 import java.util.Collection ; 57 import java.util.HashMap ; 58 import java.util.Map ; 59 60 public class JaxbBeanType extends TypeStrategy { 61 protected static final L10N L = new L10N(BeanTypeStrategy.class); 62 63 private static final HashMap <Class ,PrimType> _primTypes 64 = new HashMap <Class ,PrimType>(); 65 66 private ArrayList <BuilderProgram> _injectList 67 = new ArrayList <BuilderProgram>(); 68 69 private ArrayList <Method > _postConstructList 70 = new ArrayList <Method >(); 71 72 private ArrayList <Method > _preDestroyList 73 = new ArrayList <Method >(); 74 75 private HashMap <String ,AttributeStrategy> _attributeMap 76 = new HashMap <String ,AttributeStrategy>(); 77 78 private AttributeStrategy _valueAttr; 79 80 private final Class <?> _type; 81 82 public JaxbBeanType(Class <?> type) 83 { 84 _type = type; 85 86 introspect(); 87 } 88 89 92 public Class getType() 93 { 94 return _type; 95 } 96 97 100 public String getTypeName() 101 { 102 return getType().getName(); 103 } 104 105 112 public Object configure(NodeBuilder builder, Node node, Object parent) 113 throws Exception 114 { 115 Object bean = builder.evalELObject(node); 116 117 if (bean != null) 118 return bean; 119 120 bean = _type.newInstance(); 121 122 configureBean(builder, bean, node); 123 124 return bean; 125 } 126 127 134 public void configureBean(NodeBuilder builder, Object bean, Node top) 135 throws Exception 136 { 137 for (int i = 0; i < _injectList.size(); i++) { 138 try { 139 _injectList.get(i).configureImpl(builder, bean); 140 } catch (Throwable e) { 141 throw builder.error(e, top); 142 } 143 } 144 145 if (_valueAttr != null) { 146 _valueAttr.configure(builder, bean, ((QNode) top).getQName(), top); 147 148 builder.configureBeanAttributesImpl(this, bean, top); 149 } 150 else 151 builder.configureBeanImpl(this, bean, top); 152 153 for (int i = 0; i < _postConstructList.size(); i++) { 154 try { 155 _postConstructList.get(i).invoke(bean); 156 } catch (Throwable e) { 157 throw builder.error(e, top); 158 } 159 } 160 161 for (int i = 0; i < _preDestroyList.size(); i++) { 162 try { 163 Method method = _preDestroyList.get(i); 164 EnvironmentListener listener; 165 listener = new WeakDestroyListener(method, bean); 166 167 Environment.addEnvironmentListener(listener); 168 } catch (Throwable e) { 169 throw builder.error(e, top); 170 } 171 } 172 } 173 174 181 @Override 182 public AttributeStrategy getAttributeStrategy(QName attrName) 183 { 184 AttributeStrategy strategy = _attributeMap.get(attrName.getName()); 185 186 if (strategy != null) 187 return strategy; 188 189 strategy = _attributeMap.get(attrName.getLocalName()); 190 191 return strategy; 192 } 193 194 private void introspect() 195 { 196 XmlAccessorType accessorType 197 = _type.getPackage().getAnnotation(XmlAccessorType.class); 198 199 if (_type.isAnnotationPresent(XmlAccessorType.class)) 200 accessorType = _type.getAnnotation(XmlAccessorType.class); 201 202 XmlAccessType accessType; 203 204 if (accessorType != null) 205 accessType = accessorType.value(); 206 else 207 accessType = XmlAccessType.PUBLIC_MEMBER; 208 209 210 InjectIntrospector.configureClassResources(_injectList, _type); 211 212 introspectMethods(accessType); 213 introspectFields(accessType); 214 } 215 216 private void introspectMethods(XmlAccessType accessType) 217 { 218 Method []methods = _type.getDeclaredMethods(); 219 220 for (int i = 0; i < methods.length; i++) { 221 Method getter = methods[i]; 222 String name = getter.getName(); 223 String setterName; 224 String propName; 225 226 if (getter.isAnnotationPresent(PostConstruct.class)) { 227 if (getter.getParameterTypes().length != 0) 228 throw new ConfigException(L.l("@PostConstruct method must have zero arguments.")); 229 230 231 _postConstructList.add(getter); 232 } 233 234 if (getter.isAnnotationPresent(PreDestroy.class)) { 235 if (getter.getParameterTypes().length != 0) 236 throw new ConfigException(L.l("@PreDestroy method must have zero arguments.")); 237 238 239 _preDestroyList.add(getter); 240 } 241 242 Class retType = getter.getReturnType(); 243 if (void.class.equals(retType)) 244 continue; 245 246 Class []paramTypes = getter.getParameterTypes(); 247 if (paramTypes.length != 0) 248 continue; 249 250 if (name.startsWith("get")) { 251 propName = name.substring(3); 252 setterName = "set" + propName; 253 254 propName = Introspector.decapitalize(propName); 255 } 256 else if (name.startsWith("is")) { 257 propName = name.substring(2); 258 setterName = "set" + propName; 259 260 if (! boolean.class.equals(retType)) 261 continue; 262 263 propName = Introspector.decapitalize(propName); 264 } 265 else 266 continue; 267 268 Class <?> propType = retType; 269 Type genericType = getter.getGenericReturnType(); 270 271 Method setter = findSetter(_type, setterName, retType); 272 if (setter != null) { 273 InjectIntrospector.configure(_injectList, 274 setter, 275 propName, 276 retType); 277 } 278 else if (! Collection .class.isAssignableFrom(retType) && 279 ! Map .class.isAssignableFrom(retType)) 280 continue; 281 282 if (hasAnnotation(XmlTransient.class, getter, setter)) 283 continue; 284 285 XmlJavaTypeAdapter xmlAdapt 286 = getAnnotation(XmlJavaTypeAdapter.class, getter, setter); 287 288 Adapter adapter = null; 289 290 if (xmlAdapt != null) 291 adapter = new Adapter(xmlAdapt.value()); 292 293 XmlValue xmlValue 294 = getAnnotation(XmlValue.class, getter, setter); 295 296 XmlElements xmlElements 297 = getAnnotation(XmlElements.class, getter, setter); 298 299 XmlElement xmlElement 300 = getAnnotation(XmlElement.class, getter, setter); 301 302 XmlElementWrapper eltWrapper 303 = getAnnotation(XmlElementWrapper.class, getter, setter); 304 305 XmlAttribute xmlAttribute 306 = getAnnotation(XmlAttribute.class, getter, setter); 307 308 name = Introspector.decapitalize(name.substring(3)); 309 310 if (xmlElements != null) { 311 } 312 else if (xmlElement != null) { 313 if (! "##default".equals(xmlElement.name())) 314 name = xmlElement.name(); 315 } 316 else if (xmlAttribute != null) { 317 if (! "##default".equals(xmlAttribute.name())) 318 name = xmlAttribute.name(); 319 } 320 else if (eltWrapper != null 321 || xmlValue != null 322 || xmlAdapt != null) { 323 } 324 else if (accessType == XmlAccessType.PROPERTY) { 325 } 326 else if (accessType == XmlAccessType.PUBLIC_MEMBER 327 && Modifier.isPublic(getter.getModifiers())) { 328 } 329 else 330 continue; 331 332 Class <?> valueType = null; 333 334 if (Collection .class.isAssignableFrom(propType)) { 335 Class componentType = getCollectionComponent(genericType); 336 337 HashMap <String ,AttributeStrategy> attrMap = _attributeMap; 338 339 if (eltWrapper != null) { 340 String wrapperName = name; 341 342 if (! "##default".equals(eltWrapper.name())) 343 wrapperName = eltWrapper.name(); 344 345 CollectionWrapperProperty wrapperAttr 346 = new CollectionWrapperProperty(); 347 348 _attributeMap.put(wrapperName, wrapperAttr); 349 350 attrMap = wrapperAttr.getAttributeMap(); 351 } 352 353 if (xmlElements != null) { 354 for (XmlElement elt : xmlElements.value()) { 355 String eltName = name; 356 Class <?> eltType = componentType; 357 358 if (! "##default".equals(elt.name())) 359 eltName = elt.name(); 360 361 if (elt.type() != XmlElement.DEFAULT.class) 362 eltType = elt.type(); 363 364 TypeStrategy typeMarshal = createTypeMarshal(eltType, 365 adapter); 366 367 AttributeStrategy attr; 368 attr = new CollectionProperty(typeMarshal, getter); 369 370 attrMap.put(eltName, attr); 371 } 372 } 373 else { 374 TypeStrategy typeMarshal = createTypeMarshal(componentType, 375 adapter); 376 377 AttributeStrategy attr; 378 attr = new CollectionProperty(typeMarshal, getter); 379 380 attrMap.put(name, attr); 381 } 382 } 383 else if (xmlValue != null) { 384 _valueAttr = createPropertyAttribute(getter, setter, 385 valueType, adapter); 386 } 387 else if (xmlElements != null) { 388 for (XmlElement elt : xmlElements.value()) { 389 String eltName = name; 390 Class <?> eltType = valueType; 391 392 if (! "##default".equals(elt.name())) 393 eltName = elt.name(); 394 395 if (elt.type() != XmlElement.DEFAULT.class) 396 eltType = elt.type(); 397 398 AttributeStrategy attr = createPropertyAttribute(getter, 399 setter, 400 eltType, 401 adapter); 402 403 if (attr != null) 404 _attributeMap.put(eltName, attr); 405 } 406 } 407 else { 408 AttributeStrategy attr = createPropertyAttribute(getter, 409 setter, 410 valueType, 411 adapter); 412 413 if (attr != null) 414 _attributeMap.put(name, attr); 415 } 416 } 417 } 418 419 private Method findSetter(Class type, 420 String setName, 421 Class retType) 422 { 423 if (type == null || Object .class.equals(type)) 424 return null; 425 426 Method []methods = type.getDeclaredMethods(); 427 428 for (int i = 0; i < methods.length; i++) { 429 Method method = methods[i]; 430 431 if (method.getParameterTypes().length != 1) 432 continue; 433 else if (! method.getParameterTypes()[0].equals(retType)) 434 continue; 435 else if (! void.class.equals(method.getReturnType())) 436 continue; 437 else if (setName.equals(method.getName())) 438 return method; 439 } 440 441 return findSetter(type.getSuperclass(), setName, retType); 442 } 443 444 private void introspectFields(XmlAccessType accessType) 445 { 446 Field []fields = _type.getDeclaredFields(); 447 448 for (int i = 0; i < fields.length; i++) { 449 Field field = fields[i]; 450 String name = field.getName(); 451 452 InjectIntrospector.configure(_injectList, 453 field, 454 name, 455 field.getType()); 456 457 if (field.isAnnotationPresent(XmlTransient.class)) 458 continue; 459 if (Modifier.isTransient(field.getModifiers())) 460 continue; 461 462 XmlJavaTypeAdapter xmlAdapt 463 = field.getAnnotation(XmlJavaTypeAdapter.class); 464 465 Adapter adapter = null; 466 467 if (xmlAdapt != null) 468 adapter = new Adapter(xmlAdapt.value()); 469 470 XmlValue xmlValue = field.getAnnotation(XmlValue.class); 471 XmlElements xmlElements = field.getAnnotation(XmlElements.class); 472 XmlElement xmlElement = field.getAnnotation(XmlElement.class); 473 XmlAttribute xmlAttribute = field.getAnnotation(XmlAttribute.class); 474 XmlElementWrapper eltWrapper 475 = field.getAnnotation(XmlElementWrapper.class); 476 477 if (xmlElements != null) { 478 } 479 else if (xmlElement != null) { 480 if (! "##default".equals(xmlElement.name())) 481 name = xmlElement.name(); 482 } 483 else if (xmlAttribute != null) { 484 if (! "##default".equals(xmlAttribute.name())) 485 name = xmlAttribute.name(); 486 } 487 else if (eltWrapper != null 488 || xmlValue != null 489 || xmlAdapt != null) { 490 } 491 else if (accessType == XmlAccessType.FIELD) { 492 } 493 else if (accessType == XmlAccessType.PUBLIC_MEMBER 494 && Modifier.isPublic(field.getModifiers())) { 495 } 496 else 497 continue; 498 499 Class <?> fieldType = field.getType(); 500 Class <?> valueType = null; 501 502 if (Collection .class.isAssignableFrom(fieldType)) { 503 Class componentType 504 = getCollectionComponent(field.getGenericType()); 505 506 HashMap <String ,AttributeStrategy> attrMap = _attributeMap; 507 508 if (eltWrapper != null) { 509 String wrapperName = name; 510 511 if (! "##default".equals(eltWrapper.name())) 512 wrapperName = eltWrapper.name(); 513 514 CollectionWrapperProperty wrapperAttr 515 = new CollectionWrapperProperty(); 516 517 _attributeMap.put(wrapperName, wrapperAttr); 518 519 attrMap = wrapperAttr.getAttributeMap(); 520 } 521 522 if (xmlElements != null) { 523 for (XmlElement elt : xmlElements.value()) { 524 String eltName = name; 525 Class <?> eltType; 526 527 if (! "##default".equals(elt.name())) 528 eltName = elt.name(); 529 530 if (elt.type() != XmlElement.DEFAULT.class) 531 eltType = elt.type(); 532 else 533 eltType = componentType; 534 535 TypeStrategy typeMarshal = createTypeMarshal(eltType, 536 adapter); 537 538 AttributeStrategy attr; 539 attr = new CollectionField(typeMarshal, field); 540 541 attrMap.put(eltName, attr); 542 } 543 } 544 else { 545 TypeStrategy typeMarshal = createTypeMarshal(componentType, 546 adapter); 547 548 AttributeStrategy attr; 549 attr = new CollectionField(typeMarshal, field); 550 551 attrMap.put(name, attr); 552 } 553 } 554 else if (xmlValue != null) { 555 _valueAttr = createFieldAttribute(field, valueType, adapter); 556 } 557 else if (xmlElements != null) { 558 for (XmlElement elt : xmlElements.value()) { 559 String eltName = name; 560 Class <?> eltType = valueType; 561 562 if (! "##default".equals(elt.name())) 563 eltName = elt.name(); 564 565 if (elt.type() != XmlElement.DEFAULT.class) 566 eltType = elt.type(); 567 568 AttributeStrategy attr = createFieldAttribute(field, 569 eltType, 570 adapter); 571 572 if (attr != null) 573 _attributeMap.put(eltName, attr); 574 } 575 } 576 else { 577 AttributeStrategy attr = createFieldAttribute(field, 578 valueType, 579 adapter); 580 581 if (attr != null) 582 _attributeMap.put(name, attr); 583 } 584 } 585 } 586 587 private AttributeStrategy createPropertyAttribute(Method getter, 588 Method setter, 589 Class valueType, 590 Adapter adapter) 591 { 592 setter.setAccessible(true); 593 594 Class type = getter.getReturnType(); 595 596 if (adapter != null) { 597 if (! type.isAssignableFrom(adapter.getBoundClass())) { 598 throw new ConfigException(L.l("Can't assign XmlAdapter {0} to property {1}", 599 adapter.getBoundClass(), 600 type)); 601 } 602 603 TypeStrategy typeMarshal; 604 605 if (valueType != null) 606 typeMarshal = createTypeMarshal(valueType, null); 607 else 608 typeMarshal = createTypeMarshal(adapter.getValueClass(), null); 609 610 AttributeStrategy attr = new AdapterProperty(setter, 611 typeMarshal, 612 adapter.getAdapter()); 613 614 return attr; 615 } 616 617 PrimType primType = _primTypes.get(type); 618 619 if (primType != null) { 620 switch (primType) { 621 case BOOLEAN: 622 case BOOLEAN_OBJECT: 623 return new BooleanProperty(setter); 624 625 case BYTE: 626 case BYTE_OBJECT: 627 return new ByteProperty(setter); 628 629 case SHORT: 630 case SHORT_OBJECT: 631 return new ShortProperty(setter); 632 633 case INTEGER: 634 case INTEGER_OBJECT: 635 return new IntProperty(setter); 636 637 case LONG: 638 case LONG_OBJECT: 639 return new LongProperty(setter); 640 641 case FLOAT: 642 case FLOAT_OBJECT: 643 return new FloatProperty(setter); 644 645 case DOUBLE: 646 case DOUBLE_OBJECT: 647 return new DoubleProperty(setter); 648 649 case STRING: 650 return new StringProperty(setter); 651 652 default: 653 throw new UnsupportedOperationException (primType.toString()); 654 } 655 } 656 657 if (Collection .class.isAssignableFrom(type)) { 658 Type retType = getter.getGenericReturnType(); 659 Class componentType = getCollectionComponent(retType); 660 661 TypeStrategy typeMarshal = createTypeMarshal(componentType, null); 662 663 return new CollectionProperty(typeMarshal, getter); 664 } 665 666 return new BeanProperty(setter, type); 667 } 668 669 private static Class getCollectionComponent(Type type) 670 { 671 Class componentType = Object .class; 672 673 if (type instanceof ParameterizedType ) { 674 ParameterizedType pType = (ParameterizedType ) type; 675 Type []typeArgs = pType.getActualTypeArguments(); 676 677 if (typeArgs.length > 0) { 678 if (typeArgs[0] instanceof Class ) 679 componentType = (Class ) typeArgs[0]; 680 else if (typeArgs[0] instanceof ParameterizedType ) 681 componentType = (Class ) ((ParameterizedType ) typeArgs[0]).getRawType(); 682 } 683 } 684 685 return componentType; 686 } 687 688 private TypeStrategy createTypeMarshal(Class valueType, Adapter adapter) 689 { 690 if (adapter != null) { 691 TypeStrategy valueStrategy = createTypeMarshal(valueType, null); 692 693 return new AdapterType(valueStrategy, adapter.getAdapter()); 694 } 695 696 PrimType primType = _primTypes.get(valueType); 697 698 if (primType != null) { 699 switch (primType) { 700 case BOOLEAN: 701 case BOOLEAN_OBJECT: 702 return BooleanType.TYPE; 703 704 case BYTE: 705 case BYTE_OBJECT: 706 return ByteType.TYPE; 707 708 case SHORT: 709 case SHORT_OBJECT: 710 return ShortType.TYPE; 711 712 case INTEGER: 713 case INTEGER_OBJECT: 714 return IntegerType.TYPE; 715 716 case LONG: 717 case LONG_OBJECT: 718 return LongType.TYPE; 719 720 case FLOAT: 721 case FLOAT_OBJECT: 722 return FloatType.TYPE; 723 724 case DOUBLE: 725 case DOUBLE_OBJECT: 726 return DoubleType.TYPE; 727 728 case STRING: 729 return StringType.TYPE; 730 } 731 } 732 733 try { 734 return TypeStrategyFactory.getTypeStrategy(valueType); 735 } catch (Exception e) { 736 throw new ConfigException(e); 737 } 738 } 739 740 private static <X extends Annotation > X getAnnotation(Class <X> annType, 741 Method getter, 742 Method setter) 743 { 744 X ann = setter != null ? setter.getAnnotation(annType) : null; 745 746 if (ann != null) 747 return ann; 748 749 return getter.getAnnotation(annType); 750 } 751 752 private static boolean hasAnnotation(Class <? extends Annotation > annType, 753 Method getter, 754 Method setter) 755 { 756 return (getter != null && getter.isAnnotationPresent(annType) 757 || setter != null && setter.isAnnotationPresent(annType)); 758 } 759 760 private AttributeStrategy createFieldAttribute(Field field, 761 Class valueType, 762 Adapter adapter) 763 { 764 field.setAccessible(true); 765 766 if (adapter != null) { 767 if (! field.getType().isAssignableFrom(adapter.getBoundClass())) { 768 throw new ConfigException(L.l("Can't assign XmlAdapter {0} to field {1}", 769 adapter.getBoundClass(), 770 field.getType())); 771 } 772 773 TypeStrategy typeMarshal; 774 775 if (valueType != null) 776 typeMarshal = createTypeMarshal(valueType, null); 777 else 778 typeMarshal = createTypeMarshal(adapter.getValueClass(), null); 779 780 AttributeStrategy attr = new AdapterField(field, 781 typeMarshal, 782 adapter.getAdapter()); 783 784 return attr; 785 } 786 787 if (valueType == null) 788 valueType = field.getType(); 789 790 PrimType primType = _primTypes.get(valueType); 791 792 if (primType != null) { 793 switch (primType) { 794 case BOOLEAN: 795 case BOOLEAN_OBJECT: 796 return new BooleanField(field); 797 798 case BYTE: 799 case BYTE_OBJECT: 800 return new ByteField(field); 801 802 case SHORT: 803 case SHORT_OBJECT: 804 return new ShortField(field); 805 806 case INTEGER: 807 case INTEGER_OBJECT: 808 return new IntField(field); 809 810 case LONG: 811 case LONG_OBJECT: 812 return new LongField(field); 813 814 case FLOAT: 815 case FLOAT_OBJECT: 816 return new FloatField(field); 817 818 case DOUBLE: 819 case DOUBLE_OBJECT: 820 return new DoubleField(field); 821 822 case STRING: 823 return new StringField(field); 824 825 default: 826 throw new UnsupportedOperationException (primType.toString()); 827 } 828 } 829 830 return new BeanField(field, valueType); 831 } 832 833 public String toString() 834 { 835 return "JaxbBeanType[" + _type.getName() + "]"; 836 } 837 838 static class Adapter { 839 private final Class <? extends XmlAdapter> _adapterClass; 840 private Class <?> _boundClass; 841 private Class <?> _valueClass; 842 843 private XmlAdapter _adapter; 844 845 Adapter(Class <? extends XmlAdapter> adapterClass) 846 { 847 _adapterClass = adapterClass; 848 849 introspect(adapterClass.getGenericSuperclass()); 850 851 try { 852 _adapter = _adapterClass.newInstance(); 853 } catch (Exception e) { 854 throw new ConfigException(e); 855 } 856 } 857 858 Class <?> getValueClass() 859 { 860 return _valueClass; 861 } 862 863 Class <?> getBoundClass() 864 { 865 return _boundClass; 866 } 867 868 XmlAdapter getAdapter() 869 { 870 return _adapter; 871 } 872 873 private void introspect(Type type) 874 { 875 if (type == null) 876 throw new NullPointerException (); 877 878 if (type instanceof ParameterizedType ) { 879 ParameterizedType pType = (ParameterizedType ) type; 880 881 if (XmlAdapter.class.equals(pType.getRawType())) { 882 Type []args = pType.getActualTypeArguments(); 883 884 _valueClass = (Class <?>) args[0]; 885 _boundClass = (Class <?>) args[1]; 886 887 return; 888 } 889 else 890 introspect(((Class ) pType.getRawType()).getGenericSuperclass()); 891 } 892 else if (type instanceof Class ) 893 introspect(((Class ) type).getGenericSuperclass()); 894 } 895 } 896 897 enum PrimType { 898 BOOLEAN, 899 BOOLEAN_OBJECT, 900 901 BYTE, 902 BYTE_OBJECT, 903 904 SHORT, 905 SHORT_OBJECT, 906 907 INTEGER, 908 INTEGER_OBJECT, 909 910 LONG, 911 LONG_OBJECT, 912 913 FLOAT, 914 FLOAT_OBJECT, 915 916 DOUBLE, 917 DOUBLE_OBJECT, 918 919 STRING, 920 }; 921 922 static { 923 _primTypes.put(boolean.class, PrimType.BOOLEAN); 924 _primTypes.put(Boolean .class, PrimType.BOOLEAN_OBJECT); 925 926 _primTypes.put(byte.class, PrimType.BYTE); 927 _primTypes.put(Byte .class, PrimType.BYTE_OBJECT); 928 929 _primTypes.put(short.class, PrimType.SHORT); 930 _primTypes.put(Short .class, PrimType.SHORT_OBJECT); 931 932 _primTypes.put(int.class, PrimType.INTEGER); 933 _primTypes.put(Integer .class, PrimType.INTEGER_OBJECT); 934 935 _primTypes.put(long.class, PrimType.LONG); 936 _primTypes.put(Long .class, PrimType.LONG_OBJECT); 937 938 _primTypes.put(float.class, PrimType.FLOAT); 939 _primTypes.put(Float .class, PrimType.FLOAT_OBJECT); 940 941 _primTypes.put(double.class, PrimType.DOUBLE); 942 _primTypes.put(Double .class, PrimType.DOUBLE_OBJECT); 943 944 _primTypes.put(String .class, PrimType.STRING); 945 } 946 } 947 | Popular Tags |