Author: struberg
Date: Thu Feb 24 10:37:05 2011
New Revision: 1074103
URL: http://svn.apache.org/viewvc?rev=1074103&view=rev
Log:
OWB-393 remove some old unused XML methods
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansXMLConfigurator.java
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansXMLConfigurator.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansXMLConfigurator.java?rev=1074103&r1=1074102&r2=1074103&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansXMLConfigurator.java
(original)
+++
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansXMLConfigurator.java
Thu Feb 24 10:37:05 2011
@@ -213,40 +213,6 @@ public final class WebBeansXMLConfigurat
/**
- * Configures and adds new stereotype annotation.
- *
- * @param stereoTypeElement new stereotype annotation element
- */
- private void addNewStereoTypeType(Element stereoTypeElement)
- {
- Class<?> clazz = XMLUtil.getElementJavaType(stereoTypeElement);
- if (clazz == null)
- {
- throw new
NonexistentTypeException(createConfigurationFailedMessage() + "Stereotype with
given class : " + stereoTypeElement.getLocalName() + " not found");
- }
-
- Class<? extends Annotation> clazzAnnot = null;
- if (!clazz.isAnnotation())
- {
- throw new WebBeansConfigurationException(
- createConfigurationFailedMessage() + "Stereotype with
given class : " + stereoTypeElement.getLocalName() + " is not an annotation
type");
- }
- else
- {
- clazzAnnot = (Class<? extends Annotation>) clazz;
- }
-
- if (xmlAnnotTypeManager.hasStereoType(clazzAnnot))
- {
- throw new DeploymentException(
- createConfigurationFailedMessage() + "Stereotype with
given class : " + stereoTypeElement.getLocalName() + " is already defined in
the XML");
- }
-
- xmlAnnotTypeManager.addStereoType(clazzAnnot, stereoTypeElement,
clazzAnnot.getName(), createConfigurationFailedMessage());
-
- }
-
- /**
* Configures enablements of the interceptors.
*
* @param interceptorsElement interceptors element
@@ -406,131 +372,7 @@ public final class WebBeansXMLConfigurat
}
}
- /**
- * Configures the type level meta data of the webbeans component.
- *
- * @param component xml webbeans component
- * @param annotationSet type level annotation set
- * @param webBeanDecleration webbeans decleration element
- */
- public <T> void configureProducerTypeLevelMetaData(AbstractOwbBean<T>
component, List<Class<? extends Annotation>> annotationSet,
- List<Element>
annotationElementList, Element webBeanDecleration)
- {
- configureBindingType(component, annotationSet, annotationElementList);
-
- // StereoType
- configureStereoType(component, annotationSet, annotationElementList);
-
- // Scope Type
- configureScopeType(component, annotationSet, annotationElementList);
-
- // Name configuration
- configureNamed(component, annotationSet, webBeanDecleration);
- }
- private boolean hasTextOnlyChild(Element element)
- {
- NodeList ns = element.getChildNodes();
- for (int i = 0; i < ns.getLength(); i++)
- {
- if (ns.item(i) instanceof Text)
- {
- continue;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Configures the webbeans scope type.
- *
- * @param component xml defined web beans component
- * @param annotationSet all annotation defined in XML
- */
- private <T> void configureScopeType(AbstractOwbBean<T> component,
List<Class<? extends Annotation>> annotationSet, List<Element>
annotationElementList)
- {
- Class<? extends Annotation> scopeType =
XMLDefinitionUtil.defineXMLTypeMetaData(component, annotationSet,
NormalScope.class,
-
createConfigurationFailedMessage()
-
+ "@Scope/@NormalScope annotation is not configured correctly");
-
- if (scopeType == null)
- {
- scopeType = XMLDefinitionUtil.defineXMLTypeMetaData(component,
annotationSet, Scope.class,
-
createConfigurationFailedMessage() + "@Scope/@NormalScope annotation is not
configured correctly");
- }
-
- if (scopeType == null)
- {
- // From stereotype
- DefinitionUtil.defineDefaultScopeType(component,
createConfigurationFailedMessage() + "@Scope annotation is not configured
correctly");
- }
- else
- {
-
component.setImplScopeType(JavassistProxyFactory.createNewAnnotationProxy(scopeType));
- }
-
- }
-
- /**
- * Configures the binding types of the web beans component.
- *
- * @param component web beans xml component
- * @param annotationSet annotations defined in the xml documents
- * @param annotationElementList child elements
- */
- private <T> void configureBindingType(AbstractOwbBean<T> component,
List<Class<? extends Annotation>> annotationSet, List<Element>
annotationElementList)
- {
- boolean isDefined = XMLDefinitionUtil.defineXMLBindingType(component,
annotationSet, annotationElementList, createConfigurationFailedMessage());
-
- if (!isDefined)
- {
- component.addQualifier(new DefaultLiteral());
- }
-
- }
-
- /**
- * Defines the component stereotypes.
- *
- * @param component webbeans component
- * @param annotationSet type-level metadata annotation set
- */
- private <T> void configureStereoType(AbstractOwbBean<T> component,
List<Class<? extends Annotation>> annotationSet, List<Element>
annotationElementList)
- {
- XMLDefinitionUtil.defineXMLStereoType(component, annotationSet);
- }
-
- /**
- * Configures the webbeans name.
- *
- * @param component webbeans component
- * @param annotationSet type-level metadata annotation set
- * @param webBeanDecleration webbeans decleration element
- */
- private <T> void configureNamed(AbstractOwbBean<T> component, List<Class<?
extends Annotation>> annotationSet, Element webBeanDecleration)
- {
- boolean isDefined = XMLDefinitionUtil.defineXMLName(component,
annotationSet);
- if (isDefined)
- {
- Element element = (Element)
webBeanDecleration.getElementsByTagName(WebBeansConstants.WEB_BEANS_XML_NAMED_ELEMENT).item(0);
- String name = element.getTextContent().trim();
-
- if (name != null && !name.equals(""))
- {
- component.setName(name);
- }
- else
- {
-
component.setName(WebBeansUtil.getManagedBeanDefaultName(component.getReturnType().getName()));
- }
- }
- else
- {
- DefinitionUtil
- .defineName(component,
component.getReturnType().getDeclaredAnnotations(),
WebBeansUtil.getManagedBeanDefaultName(component.getReturnType().getSimpleName()));
- }
- }
/**
* Gets error message for XML parsing of the current XML file.