TypeDatapublic class TypeData extends Object Basic data from which we derive all our TypeInfo. Any j2eeType must either
have 1 or more legal parent types ( in which case it is a subType),
or must have a contained-by j2eeType (possibly null), in which case it is a
top-level type, possibly contained by something else.
Separating these two ideas enables reasonably short types that don't have to
artifically include the singletons they are logically contained in. For example,
it enables the type "X-ConfigConfig" instead of
"X-DomainRoot.X-DomainConfig.X-ConfigConfig", which is considerably longer
than (unnecessarily so). |
Fields Summary |
---|
private final String | mJ2EEType | private final Set | mLegalParentsTypes | private final String | mContainedByJ2EEType |
Constructors Summary |
---|
protected TypeData(String j2eeType, String parentJ2EEType)Same as TypeData( j2eeType, newSet( parentJ2EEType ) )
this( j2eeType, Collections.singleton( parentJ2EEType ) );
| protected TypeData(String j2eeType, Set legalParentJ2EETypes)
this( j2eeType, legalParentJ2EETypes, null );
| protected TypeData(String j2eeType, Set legalParentJ2EETypes, String containedByJ2EEType)
if ( containedByJ2EEType != null && legalParentJ2EETypes != null )
{
throw new IllegalArgumentException( "can't have both parents and contained type" );
}
mJ2EEType = j2eeType;
if ( containedByJ2EEType != null )
{
mContainedByJ2EEType = containedByJ2EEType;
mLegalParentsTypes = null;
}
else
{
mContainedByJ2EEType = null;
mLegalParentsTypes = legalParentJ2EETypes == null ?
null : Collections.unmodifiableSet( legalParentJ2EETypes );
}
|
Methods Summary |
---|
public boolean | equals(java.lang.Object rhs)
boolean equals = false;
if ( this == rhs )
{
equals = true;
}
else if ( ! (rhs instanceof TypeData) )
{
equals = false;
}
else
{
final TypeData rhsTypeData = (TypeData)rhs;
equals = ObjectUtil.equals( mJ2EEType, rhsTypeData.mJ2EEType ) &&
mLegalParentsTypes.equals( rhsTypeData.mLegalParentsTypes ) &&
ObjectUtil.equals( mContainedByJ2EEType, rhsTypeData.mContainedByJ2EEType );
}
return equals;
| public final java.lang.String | getContaineeByJ2EEType()
return( mContainedByJ2EEType );
| public final java.lang.String | getJ2EEType()
return( mJ2EEType );
| public final java.util.Set | getLegalParentJ2EETypes()
return( mLegalParentsTypes );
| public int | hashCode()
return ObjectUtil.hashCode(
mJ2EEType, mLegalParentsTypes, mContainedByJ2EEType);
| public boolean | isSubType()
return( mLegalParentsTypes != null );
|
|