public static void initImportHandler(TypeBinding typeBinding) { typeBinding.setHandler(ImportHandler.HANDLER); }
public static void initAliasHandler(TypeBinding typeBinding) { typeBinding.setHandler(NamedAliasHandler.NAMED_ALIAS_HANDLER); }
public static void initRefHandler(TypeBinding typeBinding) { typeBinding.setHandler(RefHandler.HANDLER); }
public static void initKeyHandler(TypeBinding typeBinding) { typeBinding.setHandler(SpringMapKeyHandler.HANDLER); // key has a value configureValueBindings(typeBinding); }
public static void initCollectionHandler(TypeBinding typeBinding) { typeBinding.setHandler(SpringCollectionHandler.HANDLER); // configure configureValueBindings(typeBinding); }
public static void initPropsHandler(TypeBinding typeBinding) { typeBinding.setHandler(PropertiesHandler.HANDLER); // props typeBinding.pushInterceptor(SpringSchemaBinding.propQName, MapEntryInterceptor.INTERCEPTOR); }
public static void initConstructorArgHandler(TypeBinding typeBinding) { typeBinding.setHandler(ConstructorArgHandler.HANDLER); // configure configureValueBindings(typeBinding); }
public static void initMapHandler(TypeBinding typeBinding) { typeBinding.setHandler(SpringMapHandler.HANDLER); // entry has an entry typeBinding.pushInterceptor(SpringSchemaBinding.entryQName, MapEntryInterceptor.INTERCEPTOR); }
public static void initPropHandler(TypeBinding typeBinding) { typeBinding.setHandler(PropHandler.HANDLER); // property takes characters typeBinding.setSimpleType(PropertyCharactersHandler.HANDLER); }
public static void initValueHandler(TypeBinding typeBinding) { typeBinding.setHandler(SpringPlainValueHandler.SPRING_PLAIN_VALUE_HANDLER); // value can take characters typeBinding.setSimpleType(PlainValueCharactersHandler.HANDLER); }
public static void initPropertyHandler(TypeBinding typeBinding) { typeBinding.setHandler(PropertyHandler.HANDLER); // property can take characters typeBinding.setSimpleType(PropertyCharactersHandler.HANDLER); // configure configureValueBindings(typeBinding); }
public static void initBeanHandler(TypeBinding typeBinding) { typeBinding.setHandler(SpringBeanHandler.HANDLER); // handle constructor-arg typeBinding.pushInterceptor(SpringSchemaBinding.constructorQName, ConstructorArgInterceptor.INTERCEPTOR); // handle properties typeBinding.pushInterceptor(SpringSchemaBinding.propertyQName, BeanPropertyInterceptor.INTERCEPTOR); // todo lookup-method // todo replaced method }
public SchemaBinding init(SchemaBinding schema) { // ignore XB property replacement schema.setReplacePropertyRefs(false); // javabean binding TypeBinding beanType = schema.getType(javabeanTypeQName); beanType.setHandler(JavaBeanHandler.HANDLER); // bean has constructor beanType.pushInterceptor(constructorQName, ConstructorInterceptor.INTERCEPTOR); // bean has properties beanType.pushInterceptor(propertyQName, PropertyInterceptor.INTERCEPTOR); // constructor binding TypeBinding constructorType = schema.getType(constructorTypeQName); constructorType.setHandler(ConstructorHandler.HANDLER); // constructor has properties constructorType.pushInterceptor(propertyQName, PropertyInterceptor.INTERCEPTOR); // property binding TypeBinding propertyType = schema.getType(propertyTypeQName); propertyType.setHandler(PropertyHandler.HANDLER); return schema; } }
private static void addXOPInclude(TypeBinding binding, SchemaBinding schema) { binding.setHandler(DefaultHandlers.XOP_HANDLER); if(binding.getParticle() != null) { throw new JBossXBRuntimeException( "XOP optimizable type has a particle which is unexpected, please, open a JIRA issue!" ); } TypeBinding anyUriType = schema.getType(Constants.QNAME_ANYURI); if(anyUriType == null) { log.warn("Type " + Constants.QNAME_ANYURI + " not bound."); } TypeBinding xopIncludeType = new TypeBinding(new QName(Constants.NS_XOP_INCLUDE, "Include")); xopIncludeType.setSchemaBinding(schema); xopIncludeType.addAttribute(new QName("href"), anyUriType, DefaultHandlers.ATTRIBUTE_HANDLER); xopIncludeType.setHandler(new XOPIncludeHandler(binding)); ElementBinding xopInclude = new ElementBinding(schema, new QName(Constants.NS_XOP_INCLUDE, "Include"), xopIncludeType); ParticleBinding particleBinding = new ParticleBinding(xopInclude); particleBinding.setMinOccurs(0); binding.addParticle(particleBinding); }
public static void initBeansHandler(TypeBinding typeBinding) { typeBinding.setHandler(SpringBeansHandler.HANDLER); // handle import typeBinding.pushInterceptor(SpringSchemaBinding.importQName, ImportInterceptor.INTERCEPTOR); // handle aliases typeBinding.pushInterceptor(SpringSchemaBinding.aliasQName, DeploymentAliasInterceptor.INTERCEPTOR); // handle beans typeBinding.pushInterceptor(SpringSchemaBinding.beanQName, DeploymentBeanInterceptor.INTERCEPTOR); // Deployment can take wildcards typeBinding.getWildcard().setWildcardHandler(DeploymentWildcardHandler.HANDLER); }
beanType.setHandler(new DefaultElementHandler() propertyType.setHandler(new DefaultElementHandler()
public static void initEntryHandler(TypeBinding typeBinding) { typeBinding.setHandler(EntryHandler.HANDLER); // entry has a key typeBinding.pushInterceptor(SpringSchemaBinding.keyQName, EntryKeyInterceptor.INTERCEPTOR); // entry has bean typeBinding.pushInterceptor(SpringSchemaBinding.beanQName, EntryValueInterceptor.INTERCEPTOR); // entry has ref typeBinding.pushInterceptor(SpringSchemaBinding.refQName, EntryValueInterceptor.INTERCEPTOR); // entry has value typeBinding.pushInterceptor(SpringSchemaBinding.valueQName, StringEntryValueInterceptor.STRING_ENTRY_VALUE_INTERCEPTOR); // entry can take a list typeBinding.pushInterceptor(SpringSchemaBinding.listQName, EntryValueInterceptor.INTERCEPTOR); // entry can take a set typeBinding.pushInterceptor(SpringSchemaBinding.setQName, EntryValueInterceptor.INTERCEPTOR); // entry can take a map typeBinding.pushInterceptor(SpringSchemaBinding.mapQName, EntryValueInterceptor.INTERCEPTOR); // entry has a null typeBinding.pushInterceptor(SpringSchemaBinding.nullQName, EntryValueInterceptor.INTERCEPTOR); }
type.setHandler(unresolvedElementHandler); type.setSimpleType(unresolvedCharactersHandler); type.setParticle(new ParticleBinding(sequence));
xopIncludeType.setSchemaBinding(schema); xopIncludeType.addAttribute(new QName("href"), anyUriType, DefaultHandlers.ATTRIBUTE_HANDLER); xopIncludeType.setHandler(new XOPIncludeHandler(parentType, schema.getXopUnmarshaller()));