ch.panter.li.bi.asn.model
Class AsnTypeImpl

java.lang.Object
  extended by ch.panter.li.bi.util.NamedItemBase
      extended by ch.panter.li.bi.asn.model.AsnTypeImpl
All Implemented Interfaces:
AsnType, NamedItem

public final class AsnTypeImpl
extends NamedItemBase
implements AsnType


Constructor Summary
AsnTypeImpl(AsnModuleImpl module, AsnType baseType, String name)
           
AsnTypeImpl(AsnModuleImpl module, AsnType baseType, String name, AsnTag tag)
           
AsnTypeImpl(AsnModuleImpl module, AsnType baseType, String name, AsnTag tag, boolean uniqueTagsRequired)
           
AsnTypeImpl(AsnModuleImpl module, AsnType baseType, String name, boolean uniqueTagsRequired)
           
AsnTypeImpl(boolean constructedEncodingAllowed, String name, AsnTag tag, AsnModule module, boolean simple)
           
AsnTypeImpl(boolean constructedEncodingAllowed, String name, AsnTag tag, boolean simple)
           
AsnTypeImpl(boolean constructedEncodingAllowed, String name, AsnTag tag, boolean simple, AsnConstraint... constraints)
           
 
Method Summary
 void add(AsnConstraint constraint)
           
 void add(AsnField field)
           
 void checkCompatible(AsnTag tagToCheck)
          Determines the same check as isCompatible but throws in case of an incompatibility.
protected  int computeHashCode(int baseHash)
           
static AsnType createUnknownType(AsnTag tag, boolean simple)
           
 AsnTag deriveApplicationTag(int tagNumber)
           
 AsnTag deriveContextTag(int tagNumber)
           
 AsnTag derivePrivateTag(int tagNumber)
           
 AsnTag deriveTag(AsnTagClass tagClass, int tagNumber)
           
 String dump()
           
 AsnType getBaseType()
           
 ReadOnlyCollection<AsnConstraint> getConstraints()
           
 AsnField getFieldByTag(AsnTag tag)
          Searches the fields of this instance for one with a tag matching the given tag.
 ReadOnlyNamedItemMap<AsnField> getFields()
           
 AsnModule getModule()
           
 AsnType getRootType()
           
 AsnTag getTag()
           
 boolean hasAnyConstraints()
           
 boolean hasConstraints()
           
 boolean hasFields()
           
 boolean isCompatible(AsnTag tagToCheck)
          Determines whether this instances tag might represent a value for this type.
 boolean isComplex()
           
 boolean isConstructedEncodingAllowed()
           
 boolean isDerivedFrom(AsnType baseTypeToCheckFor)
           
protected  boolean isEqualTo(Object compare)
           
 boolean isExtensionAllowed()
           
 boolean isRootType()
           
 boolean isSimple()
           
 boolean isUniqueTagsRequired()
           
 void setExtensionAllowed(boolean extensionAllowed)
           
 String toString()
           
 
Methods inherited from class ch.panter.li.bi.util.NamedItemBase
equals, getName, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ch.panter.li.bi.util.NamedItem
getName
 

Constructor Detail

AsnTypeImpl

AsnTypeImpl(boolean constructedEncodingAllowed,
            String name,
            AsnTag tag,
            boolean simple,
            AsnConstraint... constraints)

AsnTypeImpl

AsnTypeImpl(boolean constructedEncodingAllowed,
            String name,
            AsnTag tag,
            boolean simple)

AsnTypeImpl

AsnTypeImpl(boolean constructedEncodingAllowed,
            String name,
            AsnTag tag,
            AsnModule module,
            boolean simple)

AsnTypeImpl

public AsnTypeImpl(AsnModuleImpl module,
                   AsnType baseType,
                   String name)

AsnTypeImpl

public AsnTypeImpl(AsnModuleImpl module,
                   AsnType baseType,
                   String name,
                   boolean uniqueTagsRequired)

AsnTypeImpl

public AsnTypeImpl(AsnModuleImpl module,
                   AsnType baseType,
                   String name,
                   AsnTag tag)

AsnTypeImpl

public AsnTypeImpl(AsnModuleImpl module,
                   AsnType baseType,
                   String name,
                   AsnTag tag,
                   boolean uniqueTagsRequired)
Method Detail

createUnknownType

public static AsnType createUnknownType(AsnTag tag,
                                        boolean simple)

getModule

public final AsnModule getModule()
Specified by:
getModule in interface AsnType

getTag

public final AsnTag getTag()
Specified by:
getTag in interface AsnType

deriveTag

public final AsnTag deriveTag(AsnTagClass tagClass,
                              int tagNumber)
Specified by:
deriveTag in interface AsnType

deriveApplicationTag

public final AsnTag deriveApplicationTag(int tagNumber)
Specified by:
deriveApplicationTag in interface AsnType

deriveContextTag

public final AsnTag deriveContextTag(int tagNumber)
Specified by:
deriveContextTag in interface AsnType

derivePrivateTag

public final AsnTag derivePrivateTag(int tagNumber)
Specified by:
derivePrivateTag in interface AsnType

isCompatible

public final boolean isCompatible(AsnTag tagToCheck)
Description copied from interface: AsnType
Determines whether this instances tag might represent a value for this type. Tests whether the constructed/primitive flag has a value allowed by this type.

Specified by:
isCompatible in interface AsnType
Parameters:
tagToCheck - the tag to check
Returns:
true if the nature of the given tag is allowed by this type

checkCompatible

public final void checkCompatible(AsnTag tagToCheck)
                           throws IllegalArgumentException
Description copied from interface: AsnType
Determines the same check as isCompatible but throws in case of an incompatibility.

Specified by:
checkCompatible in interface AsnType
Parameters:
tagToCheck - the tag to check
Throws:
IllegalArgumentException - in case the tag is considered incompatible

isSimple

public final boolean isSimple()
Specified by:
isSimple in interface AsnType

isComplex

public final boolean isComplex()
Specified by:
isComplex in interface AsnType

isConstructedEncodingAllowed

public final boolean isConstructedEncodingAllowed()
Specified by:
isConstructedEncodingAllowed in interface AsnType

isRootType

public final boolean isRootType()
Specified by:
isRootType in interface AsnType

getBaseType

public final AsnType getBaseType()
Specified by:
getBaseType in interface AsnType

getRootType

public final AsnType getRootType()
Specified by:
getRootType in interface AsnType

isDerivedFrom

public final boolean isDerivedFrom(AsnType baseTypeToCheckFor)
Specified by:
isDerivedFrom in interface AsnType

isExtensionAllowed

public final boolean isExtensionAllowed()
Specified by:
isExtensionAllowed in interface AsnType

setExtensionAllowed

public final void setExtensionAllowed(boolean extensionAllowed)

isUniqueTagsRequired

public final boolean isUniqueTagsRequired()
Specified by:
isUniqueTagsRequired in interface AsnType

hasConstraints

public final boolean hasConstraints()
Specified by:
hasConstraints in interface AsnType

hasAnyConstraints

public final boolean hasAnyConstraints()
Specified by:
hasAnyConstraints in interface AsnType

getConstraints

public final ReadOnlyCollection<AsnConstraint> getConstraints()
Specified by:
getConstraints in interface AsnType

add

public final void add(AsnConstraint constraint)

hasFields

public final boolean hasFields()
Specified by:
hasFields in interface AsnType

getFields

public final ReadOnlyNamedItemMap<AsnField> getFields()
Specified by:
getFields in interface AsnType

getFieldByTag

public final AsnField getFieldByTag(AsnTag tag)
Description copied from interface: AsnType
Searches the fields of this instance for one with a tag matching the given tag.

Specified by:
getFieldByTag in interface AsnType
Parameters:
tag - the tag of the field to search for
Returns:
the field that matches the given tag or null if no match was found

add

public final void add(AsnField field)

isEqualTo

protected boolean isEqualTo(Object compare)
Overrides:
isEqualTo in class NamedItemBase

computeHashCode

protected int computeHashCode(int baseHash)
Overrides:
computeHashCode in class NamedItemBase

dump

public String dump()

toString

public String toString()
Overrides:
toString in class NamedItemBase


Copyright 2007-2007 SourceForge. All Rights Reserved.