Package org.eclipse.birt.report.model.api.command

# Class NameException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.eclipse.birt.core.exception.BirtException
org.eclipse.birt.report.model.api.ModelException
org.eclipse.birt.report.model.api.activity.SemanticException
org.eclipse.birt.report.model.api.command.NameException

All Implemented Interfaces:
  `Serializable`

public class NameException extends SemanticException
Indicates an error when setting the name of an element.

See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`DESIGN_EXCEPTION_DOT_FORBIDDEN`
Deprecated.
replaced by `DESIGN_EXCEPTION_INVALID_NAME`
`static final String`
`DESIGN_EXCEPTION_DUPLICATE`
Error code indicating the new name duplicates an existing name in the same name space.
`static final String`
`DESIGN_EXCEPTION_HAS_REFERENCES`
Error code indicating the element has references, so it cannot be anonymous.
`static final String`
`DESIGN_EXCEPTION_INVALID_NAME`
`static final String`
`DESIGN_EXCEPTION_INVALID_STYLE_NAME`
The style name is invalid for CSS2 specification.
`static final String`
`DESIGN_EXCEPTION_NAME_FORBIDDEN`
Error code indicating the element is not allowed to have name.
`static final String`
`DESIGN_EXCEPTION_NAME_REQUIRED`
Error code indicating the element miss its name, while the name is required.
`protected String`
`name`
The new element name.

### Fields inherited from class org.eclipse.birt.report.model.api.activity.SemanticException

`DESIGN_EXCEPTION__EXPORT_ELEMENT_FAIL, element`

### Fields inherited from class org.eclipse.birt.report.model.api.ModelException

`PLUGIN_ID`

### Fields inherited from class org.eclipse.birt.core.exception.BirtException

`CANCEL, ERROR, INFO, oaMessageArguments, OK, pluginId, rb, severity, sResourceKey, WARNING`

## Constructor Summary

Constructors
Constructor
Description
`NameException(org.eclipse.birt.report.model.core.DesignElement obj, String str, String errCode)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`getLocalizedMessage()`
`String`
`getName()`
Returns the name that caused the error.

### Methods inherited from class org.eclipse.birt.report.model.api.activity.SemanticException

`getElement, getElementName, getMessage`

### Methods inherited from class org.eclipse.birt.core.exception.BirtException

`getErrorCode, getLocalizedMessage, getPluginId, getSeverity, setSeverity`

### Methods inherited from class java.lang.Throwable

`addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### name

protected String name
The new element name.

### DESIGN_EXCEPTION_NAME_REQUIRED

public static final String DESIGN_EXCEPTION_NAME_REQUIRED
Error code indicating the element miss its name, while the name is required.

See Also:
  - Constant Field Values

### DESIGN_EXCEPTION_NAME_FORBIDDEN

public static final String DESIGN_EXCEPTION_NAME_FORBIDDEN
Error code indicating the element is not allowed to have name.

See Also:
  - Constant Field Values

### DESIGN_EXCEPTION_DUPLICATE

public static final String DESIGN_EXCEPTION_DUPLICATE
Error code indicating the new name duplicates an existing name in the same name space.

See Also:
  - Constant Field Values

### DESIGN_EXCEPTION_HAS_REFERENCES

public static final String DESIGN_EXCEPTION_HAS_REFERENCES
Error code indicating the element has references, so it cannot be anonymous.

See Also:
  - Constant Field Values

### DESIGN_EXCEPTION_DOT_FORBIDDEN

@Deprecated public static final String DESIGN_EXCEPTION_DOT_FORBIDDEN
Deprecated.
replaced by `DESIGN_EXCEPTION_INVALID_NAME`
The character "." is forbidden to NamePropertyType.

See Also:
  - Constant Field Values

### DESIGN_EXCEPTION_INVALID_NAME

public static final String DESIGN_EXCEPTION_INVALID_NAME

See Also:
  - Constant Field Values

### DESIGN_EXCEPTION_INVALID_STYLE_NAME

public static final String DESIGN_EXCEPTION_INVALID_STYLE_NAME
The style name is invalid for CSS2 specification.

See Also:
  - Constant Field Values

## Constructor Details

### NameException

public NameException(org.eclipse.birt.report.model.core.DesignElement obj, String str, String errCode)
Constructor.

Parameters:
  `obj` - the element being changed.
  `str` - the name that caused the error.
  `errCode` - what went wrong.

## Method Details

### getName

public String getName()
Returns the name that caused the error.

Returns:
  the name.

### getLocalizedMessage

public String getLocalizedMessage()

Overrides:
  `getLocalizedMessage` in class `SemanticException`