public ClassDescriptor buildRootDescriptor() {
    XMLDescriptor descriptor = new XMLDescriptor();
    descriptor.setJavaClass(AnyCollectionRoot.class);
    descriptor.setDefaultRootElement("root");

    XMLAnyCollectionMapping mapping = new XMLAnyCollectionMapping();
    mapping.setAttributeName("any");
    mapping.setGetMethodName("getAny");
    mapping.setSetMethodName("setAny");
    descriptor.addMapping(mapping);

    return descriptor;
  }
Пример #2
0
  protected void addOpenMappings() {
    XMLAnyCollectionMapping anyMapping = new XMLAnyCollectionMapping();
    anyMapping.setAttributeName(ANY_MAPPING_ATTRIBUTE_NAME);
    anyMapping.setGetMethodName(ANY_MAPPING_GET_METHOD_NAME);
    anyMapping.setSetMethodName(ANY_MAPPING_SET_METHOD_NAME);
    anyMapping.setUseXMLRoot(true);
    getXmlDescriptor().addMapping(anyMapping);

    XMLAnyAttributeMapping anyAttrMapping = new XMLAnyAttributeMapping();
    anyAttrMapping.setAttributeName("openContentPropertiesAttributes");
    anyAttrMapping.setGetMethodName("_getOpenContentPropertiesAttributesMap");
    anyAttrMapping.setSetMethodName("_setOpenContentPropertiesAttributesMap");
    getXmlDescriptor().addMapping(anyAttrMapping);
  }
  public ClassDescriptor buildRootDescriptor() {
    XMLDescriptor descriptor = new XMLDescriptor();
    descriptor.setJavaClass(Root.class);
    descriptor.setDefaultRootElement("root");

    XMLAnyCollectionMapping mapping = new XMLAnyCollectionMapping();
    mapping.setAttributeName("any");
    mapping.setGetMethodName("getAny");
    mapping.setSetMethodName("setAny");
    mapping.setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT);
    descriptor.addMapping(mapping);

    return descriptor;
  }