Skip to content

Commit

Permalink
javadocs/comments
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@382 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
nickarls committed Nov 29, 2008
1 parent 127e292 commit 7986c41
Show file tree
Hide file tree
Showing 8 changed files with 546 additions and 21 deletions.
@@ -1,14 +1,43 @@
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.jboss.webbeans.exceptions;

/**
* Helper superclass for exception information
*
* @author Pete Muir
*/
public class Location
{

// The category of the exception
private String type;

// The bean the exception occurred in
private String bean;

// The element the exception occurred in
private String element;

/**
* Constructor
*
* @param type The category
* @param bean The bean
* @param element The element
*/
public Location(String type, String bean, String element)
{
super();
Expand All @@ -17,36 +46,71 @@ public Location(String type, String bean, String element)
this.element = element;
}

/**
* Gets the type of the exception
*
* @return The type
*/
public String getType()
{
return type;
}

/**
* Sets the type of the exception
*
* @param type The type
*/
public void setType(String type)
{
this.type = type;
}

/**
* Gets the bean the exception occurred in
*
* @return The bean
*/
public String getBean()
{
return bean;
}

/**
* Sets the bean the exception occurred in
*
* @param bean The bean
*/
public void setBean(String bean)
{
this.bean = bean;
}

/**
* Gets the element the exception occurred in
*
* @return The element
*/
public String getElement()
{
return element;
}

/**
* Sets the element the exception occurred in
*
* @param element The element
*/
public void setElement(String element)
{
this.element = element;
}

/**
* Gets the summarizing message
*
* @return The message
*/
protected String getMessage()
{
String location = "";
Expand Down
@@ -1,26 +1,68 @@
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.jboss.webbeans.exceptions;

/**
* Exception location info for name resolution exceptions
*
* @author Pete Muir
*/
public class NameResolutionLocation extends Location
{

// The target of the failure
private String target;

/**
* Constructor
*
* @param target The target of the failure
*/
public NameResolutionLocation(String target)
{
super("Named Based Resolution", null, null);

}

/**
* Gets the target
*
* @return The target
*/
public String getTarget()
{
return target;
}

/**
* Sets the target
*
* @param target The target
*/
public void setTarget(String target)
{
this.target = target;
}

/**
* Gets the exception message
*
* @return The message
*/
@Override
protected String getMessage()
{
Expand Down
@@ -1,28 +1,70 @@
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.jboss.webbeans.exceptions;

import javax.webbeans.DefinitionException;

/**
* Exception for incorrect scope usage
*
* @author Pete Muir
*/
public class NotAScopeException extends DefinitionException
{
private static final long serialVersionUID = 1L;

/**
* Constructor
*/
public NotAScopeException()
{
super();
}

/**
* Constructor
*
* @param message The exception message
* @param throwable The root exception
*/
public NotAScopeException(String message, Throwable throwable)
{
super(message, throwable);
}

/**
* Constructor
*
* @param message The exception message
*/
public NotAScopeException(String message)
{
super(message);
}

/**
* Constructor
*
* @param throwable The root exception
*/
public NotAScopeException(Throwable throwable)
{
super(throwable);
}

}
@@ -1,3 +1,20 @@
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.jboss.webbeans.util;

import java.lang.reflect.Method;
Expand All @@ -11,33 +28,90 @@
import org.jboss.webbeans.bean.XmlSimpleBean;
import org.jboss.webbeans.introspector.AnnotatedMethod;

/**
* Utility class for creating Web Beans
*
* @author Pete Muir
*/
public class BeanFactory
{
/**
* Creates a simple, annotation defined Web Bean
*
* @param <T> The type
* @param clazz The class
* @param manager The Web Beans manager
* @return A Web Bean
*/
public static <T> SimpleBean<T> createSimpleBean(Class<T> clazz, ManagerImpl manager)
{
return new SimpleBean<T>(clazz, manager);
}

/**
* Creates a simple, XML defined Web Bean
*
* @param <T> The type
* @param clazz The class
* @param manager The Web Beans manager
* @return A Web Bean
*/
public static <T> XmlSimpleBean<T> createXmlSimpleBean(Class<T> clazz, ManagerImpl manager)
{
return new XmlSimpleBean<T>(clazz, manager);
}

/**
* Creates a simple, annotation defined Enterprise Web Bean
*
* @param <T> The type
* @param clazz The class
* @param manager The Web Beans manager
* @return An Enterprise Web Bean
*/
public static <T> EnterpriseBean<T> createEnterpriseBean(Class<T> clazz, ManagerImpl manager)
{
return new EnterpriseBean<T>(clazz, manager);
}

/**
* Creates a simple, XML defined Enterprise Web Bean
*
* @param <T> The type
* @param clazz The class
* @param manager The Web Beans manager
* @return An Enterprise Web Bean
*/
public static <T> XmlEnterpriseBean<T> createXmlEnterpriseBean(Class<T> clazz, ManagerImpl manager)
{
return new XmlEnterpriseBean<T>(clazz, manager);
}

/**
* Creates a producer method Web Bean
*
* @param <T> The type
* @param type The class
* @param method The underlying method
* @param manager The Web Beans manager
* @param declaringBean The declaring bean abstraction
* @return A producer Web Bean
*/
public static <T> ProducerMethodBean<T> createProducerMethodBean(Class<T> type, Method method, ManagerImpl manager, AbstractClassBean<?> declaringBean)
{
return new ProducerMethodBean<T>(method, declaringBean, manager);
}


/**
* Creates a producer method Web Bean
*
* @param <T> The type
* @param type The class
* @param method The underlying method
* @param manager The Web Beans manager
* @param declaringBean The declaring bean abstraction
* @return A producer Web Bean
*/
public static <T> ProducerMethodBean<T> createProducerMethodBean(Class<T> type, AnnotatedMethod<T> method, ManagerImpl manager, AbstractClassBean<?> declaringBean)
{
return new ProducerMethodBean<T>(method, declaringBean, manager);
Expand Down

0 comments on commit 7986c41

Please sign in to comment.