org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping.setAttributeAccessor()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(8.5k)|赞(0)|评价(0)|浏览(118)

本文整理了Java中org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping.setAttributeAccessor()方法的一些代码示例,展示了XMLCompositeDirectCollectionMapping.setAttributeAccessor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLCompositeDirectCollectionMapping.setAttributeAccessor()方法的具体详情如下:
包路径:org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping
类名称:XMLCompositeDirectCollectionMapping
方法名:setAttributeAccessor

XMLCompositeDirectCollectionMapping.setAttributeAccessor介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

  1. /**
  2. * PUBLIC:
  3. * Allows the user to indicate that this mapping should also allow for mixed content in addition to
  4. * any of the elements in the choice. The grouping element parameter is used in the case that there is
  5. * a common grouping element to all the other elements in this choice. If so, that grouping element can
  6. * be specified here to allow the mixed content to be written/detected inside the wrapper element.
  7. * @since EclipseLink 2.3.1
  8. */
  9. public void setMixedContent(String groupingElement) {
  10. isMixedContent = true;
  11. String xpath = groupingElement;
  12. if(groupingElement.length() == 0) {
  13. xpath = "text()";
  14. } else {
  15. xpath += "/" + "text()";
  16. }
  17. XMLField field = new XMLField(xpath);
  18. XMLCompositeDirectCollectionMapping xmlMapping = new XMLCompositeDirectCollectionMapping();
  19. Class theClass = ClassConstants.STRING;
  20. xmlMapping.setAttributeElementClass(theClass);
  21. xmlMapping.setField(field);
  22. xmlMapping.setAttributeAccessor(temporaryAccessor);
  23. this.mixedContentMapping = xmlMapping;
  24. this.choiceElementMappings.put(field, xmlMapping);
  25. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. /**
  2. * PUBLIC:
  3. * Allows the user to indicate that this mapping should also allow for mixed content in addition to
  4. * any of the elements in the choice. The grouping element parameter is used in the case that there is
  5. * a common grouping element to all the other elements in this choice. If so, that grouping element can
  6. * be specified here to allow the mixed content to be written/detected inside the wrapper element.
  7. * @since EclipseLink 2.3.1
  8. */
  9. public void setMixedContent(String groupingElement) {
  10. isMixedContent = true;
  11. String xpath = groupingElement;
  12. if(groupingElement.length() == 0) {
  13. xpath = "text()";
  14. } else {
  15. xpath += "/" + "text()";
  16. }
  17. XMLField field = new XMLField(xpath);
  18. XMLCompositeDirectCollectionMapping xmlMapping = new XMLCompositeDirectCollectionMapping();
  19. Class theClass = ClassConstants.STRING;
  20. xmlMapping.setAttributeElementClass(theClass);
  21. xmlMapping.setField(field);
  22. xmlMapping.setAttributeAccessor(temporaryAccessor);
  23. this.mixedContentMapping = xmlMapping;
  24. this.choiceElementMappings.put(field, xmlMapping);
  25. }

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  1. private void addChoiceElementMapping(XMLField xmlField, Class theClass){
  2. if (xmlField.getLastXPathFragment().nameIsText()) {
  3. XMLCompositeDirectCollectionMapping xmlMapping = new XMLCompositeDirectCollectionMapping();
  4. xmlMapping.setAttributeElementClass(theClass);
  5. xmlMapping.setField(xmlField);
  6. xmlMapping.setAttributeAccessor(temporaryAccessor);
  7. this.choiceElementMappings.put(xmlField, xmlMapping);
  8. } else {
  9. XMLCompositeCollectionMapping xmlMapping = new XMLCompositeCollectionMapping();
  10. if(!theClass.equals(ClassConstants.OBJECT)){
  11. xmlMapping.setReferenceClass(theClass);
  12. }
  13. xmlMapping.setField(xmlField);
  14. xmlMapping.setAttributeAccessor(temporaryAccessor);
  15. this.choiceElementMappings.put(xmlField, xmlMapping);
  16. }
  17. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. xmlMapping.setAttributeElementClass(theClass);
  2. xmlMapping.setField(xmlField);
  3. xmlMapping.setAttributeAccessor(temporaryAccessor);
  4. this.choiceElementMappings.put(xmlField, xmlMapping);
  5. this.choiceElementMappingsByClass.put(theClass, xmlMapping);

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  1. private void addChoiceElementMapping(XMLField xmlField, String className){
  2. if (xmlField.getLastXPathFragment().nameIsText()) {
  3. XMLCompositeDirectCollectionMapping xmlMapping = new XMLCompositeDirectCollectionMapping();
  4. Class theClass = XMLConversionManager.getDefaultXMLManager().convertClassNameToClass(className);
  5. xmlMapping.setAttributeElementClass(theClass);
  6. xmlMapping.setField(xmlField);
  7. xmlMapping.setAttributeAccessor(temporaryAccessor);
  8. this.choiceElementMappings.put(xmlField, xmlMapping);
  9. } else {
  10. XMLCompositeCollectionMapping xmlMapping = new XMLCompositeCollectionMapping();
  11. if(!className.equals("java.lang.Object")){
  12. xmlMapping.setReferenceClassName(className);
  13. }
  14. xmlMapping.setField(xmlField);
  15. xmlMapping.setAttributeAccessor(temporaryAccessor);
  16. this.choiceElementMappings.put(xmlField, xmlMapping);
  17. }
  18. }

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

  1. private void addChoiceElementMapping(XMLField xmlField, Class theClass){
  2. if (xmlField.getLastXPathFragment().nameIsText() || xmlField.getLastXPathFragment().isAttribute()) {
  3. XMLCompositeDirectCollectionMapping xmlMapping = new XMLCompositeDirectCollectionMapping();
  4. xmlMapping.setAttributeElementClass(theClass);
  5. xmlMapping.setField(xmlField);
  6. xmlMapping.setAttributeAccessor(temporaryAccessor);
  7. this.choiceElementMappings.put(xmlField, xmlMapping);
  8. this.choiceElementMappingsByClass.put(theClass, xmlMapping);
  9. } else {
  10. if(isBinaryType(theClass)) {
  11. XMLBinaryDataCollectionMapping xmlMapping = new XMLBinaryDataCollectionMapping();
  12. xmlMapping.setField(xmlField);
  13. xmlMapping.setAttributeElementClass(theClass);
  14. xmlMapping.setAttributeAccessor(temporaryAccessor);
  15. this.fieldsToConverters.put(xmlField, xmlMapping.getValueConverter());
  16. this.choiceElementMappings.put(xmlField, xmlMapping);
  17. this.choiceElementMappingsByClass.put(theClass, xmlMapping);
  18. } else {
  19. XMLCompositeCollectionMapping xmlMapping = new XMLCompositeCollectionMapping();
  20. if(!theClass.equals(ClassConstants.OBJECT)){
  21. xmlMapping.setReferenceClass(theClass);
  22. }
  23. xmlMapping.setField(xmlField);
  24. xmlMapping.setAttributeAccessor(temporaryAccessor);
  25. this.choiceElementMappings.put(xmlField, xmlMapping);
  26. this.choiceElementMappingsByClass.put(theClass, xmlMapping);
  27. }
  28. }
  29. }

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

  1. private void addChoiceElementMapping(XMLField xmlField, String className){
  2. if (xmlField.getLastXPathFragment().nameIsText() || xmlField.getLastXPathFragment().isAttribute()) {
  3. XMLCompositeDirectCollectionMapping xmlMapping = new XMLCompositeDirectCollectionMapping();
  4. xmlMapping.setAttributeElementClassName(className);
  5. xmlMapping.setField(xmlField);
  6. xmlMapping.setAttributeAccessor(temporaryAccessor);
  7. this.choiceElementMappings.put(xmlField, xmlMapping);
  8. this.choiceElementMappingsByClassName.put(className, xmlMapping);
  9. } else {
  10. if(isBinaryType(className)) {
  11. XMLBinaryDataCollectionMapping xmlMapping = new XMLBinaryDataCollectionMapping();
  12. xmlMapping.setField(xmlField);
  13. xmlMapping.setAttributeAccessor(temporaryAccessor);
  14. Class theClass = XMLConversionManager.getDefaultXMLManager().convertClassNameToClass(className);
  15. xmlMapping.setAttributeElementClass(theClass);
  16. this.choiceElementMappings.put(xmlField, xmlMapping);
  17. this.choiceElementMappingsByClassName.put(className, xmlMapping);
  18. } else {
  19. XMLCompositeCollectionMapping xmlMapping = new XMLCompositeCollectionMapping();
  20. if(!className.equals("java.lang.Object")){
  21. xmlMapping.setReferenceClassName(className);
  22. }
  23. xmlMapping.setField(xmlField);
  24. xmlMapping.setAttributeAccessor(temporaryAccessor);
  25. this.choiceElementMappings.put(xmlField, xmlMapping);
  26. this.choiceElementMappingsByClassName.put(className, xmlMapping);
  27. }
  28. }
  29. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. private void addChoiceElementMapping(XMLField xmlField, String className){
  2. if (xmlField.getLastXPathFragment().nameIsText() || xmlField.getLastXPathFragment().isAttribute()) {
  3. XMLCompositeDirectCollectionMapping xmlMapping = new XMLCompositeDirectCollectionMapping();
  4. xmlMapping.setAttributeElementClassName(className);
  5. xmlMapping.setField(xmlField);
  6. xmlMapping.setAttributeAccessor(temporaryAccessor);
  7. this.choiceElementMappings.put(xmlField, xmlMapping);
  8. this.choiceElementMappingsByClassName.put(className, xmlMapping);
  9. } else {
  10. if(isBinaryType(className)) {
  11. XMLBinaryDataCollectionMapping xmlMapping = new XMLBinaryDataCollectionMapping();
  12. xmlMapping.setField(xmlField);
  13. xmlMapping.setAttributeAccessor(temporaryAccessor);
  14. Class theClass = XMLConversionManager.getDefaultXMLManager().convertClassNameToClass(className);
  15. xmlMapping.setAttributeElementClass(theClass);
  16. this.choiceElementMappings.put(xmlField, xmlMapping);
  17. this.choiceElementMappingsByClassName.put(className, xmlMapping);
  18. } else {
  19. XMLCompositeCollectionMapping xmlMapping = new XMLCompositeCollectionMapping();
  20. if(!className.equals("java.lang.Object")){
  21. xmlMapping.setReferenceClassName(className);
  22. }
  23. xmlMapping.setField(xmlField);
  24. xmlMapping.setAttributeAccessor(temporaryAccessor);
  25. this.choiceElementMappings.put(xmlField, xmlMapping);
  26. this.choiceElementMappingsByClassName.put(className, xmlMapping);
  27. }
  28. }
  29. }

相关文章