| Classes in this File | Line Coverage | Branch Coverage | Complexity | |||||||
| IdentifierDescriptor |
|
| 1.0;1 |
| 1 | /* |
|
| 2 | * Copyright 2004 Chris Nelson |
|
| 3 | * |
|
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
|
| 5 | * you may not use this file except in compliance with the License. |
|
| 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 |
|
| 7 | * Unless required by applicable law or agreed to in writing, |
|
| 8 | * software distributed under the License is distributed on an "AS IS" BASIS, |
|
| 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
| 10 | * See the License for the specific language governing permissions and limitations under the License. |
|
| 11 | */ |
|
| 12 | package org.trails.descriptor; |
|
| 13 | ||
| 14 | ||
| 15 | /** |
|
| 16 | * @author fus8882 |
|
| 17 | * <p/> |
|
| 18 | * TODO To change the template for this generated type comment go to |
|
| 19 | * Window - Preferences - Java - Code Style - Code Templates |
|
| 20 | */ |
|
| 21 | public class IdentifierDescriptor extends TrailsPropertyDescriptor implements IIdentifierDescriptor |
|
| 22 | { |
|
| 23 | 39 | private boolean generated = true; |
| 24 | ||
| 25 | public IdentifierDescriptor(Class beanType, IPropertyDescriptor descriptor) |
|
| 26 | { |
|
| 27 | 9 | super(beanType, descriptor.getPropertyType()); |
| 28 | 9 | copyFrom(descriptor); |
| 29 | 9 | setSearchable(false); |
| 30 | 9 | } |
| 31 | ||
| 32 | /** |
|
| 33 | * @param realDescriptor |
|
| 34 | */ |
|
| 35 | public IdentifierDescriptor(Class beanType, Class type) |
|
| 36 | { |
|
| 37 | 1 | super(beanType, type); |
| 38 | 1 | setSearchable(false); |
| 39 | 1 | } |
| 40 | ||
| 41 | public IdentifierDescriptor(Class beanType, String name, Class type) |
|
| 42 | { |
|
| 43 | 29 | super(beanType, name, type); |
| 44 | 29 | setSearchable(false); |
| 45 | 29 | } |
| 46 | ||
| 47 | /* (non-Javadoc) |
|
| 48 | * @see org.trails.descriptor.PropertyDescriptor#isIdentifier() |
|
| 49 | */ |
|
| 50 | public boolean isIdentifier() |
|
| 51 | { |
|
| 52 | 41 | return true; |
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * @return Returns the generated. |
|
| 57 | */ |
|
| 58 | public boolean isGenerated() |
|
| 59 | { |
|
| 60 | 8 | return generated; |
| 61 | } |
|
| 62 | ||
| 63 | /** |
|
| 64 | * @param generated The generated to set. |
|
| 65 | */ |
|
| 66 | public void setGenerated(boolean generated) |
|
| 67 | { |
|
| 68 | 9 | this.generated = generated; |
| 69 | 9 | } |
| 70 | ||
| 71 | public Object clone() |
|
| 72 | { |
|
| 73 | 4 | return new IdentifierDescriptor(getBeanType(), this); |
| 74 | } |
|
| 75 | ||
| 76 | ||
| 77 | } |