Class AttributePSVImpl
- java.lang.Object
-
- org.smooks.engine.delivery.sax.ng.org.apache.xerces.impl.xs.AttributePSVImpl
-
- All Implemented Interfaces:
AttributePSVI
,ItemPSVI
public class AttributePSVImpl extends Object implements AttributePSVI
Attribute PSV infoset augmentations implementation. The PSVI information for attributes will be available at the startElement call.- Version:
- $Id$
- Author:
- Elena Litani IBM
-
-
Field Summary
Fields Modifier and Type Field Description protected XSAttributeDeclaration
fDeclaration
attribute declarationprotected String[]
fErrors
error codes and error messagesprotected boolean
fIsConstant
true if this object is immutableprotected boolean
fSpecified
If this attribute was explicitly given a value in the original document, this is false; otherwise, it is trueprotected XSTypeDefinition
fTypeDecl
type of attribute, simpleTypeprotected short
fValidationAttempted
validation attempted: none, partial, fullprotected String
fValidationContext
validation context: could be QName or XPath expressionprotected short
fValidity
validity: valid, invalid, unknownprotected ValidatedInfo
fValue
Schema value-
Fields inherited from interface org.smooks.engine.delivery.sax.ng.org.apache.xerces.xs.ItemPSVI
VALIDATION_FULL, VALIDATION_NONE, VALIDATION_PARTIAL, VALIDITY_INVALID, VALIDITY_NOTKNOWN, VALIDITY_VALID
-
-
Constructor Summary
Constructors Constructor Description AttributePSVImpl()
AttributePSVImpl(boolean isConstant, AttributePSVI attrPSVI)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ItemPSVI
constant()
Returns a reference to an immutable instance with the same data that this instance ofItemPSVI
currently has.Object
getActualNormalizedValue()
[schema normalized value]
: Binding specific actual value ornull
if the value is in error.short
getActualNormalizedValueType()
The actual value built-in datatype, e.g.XSAttributeDeclaration
getAttributeDeclaration()
An item isomorphic to the attribute declaration used to validate this attribute.StringList
getErrorCodes()
A list of error codes generated from validation attempts.StringList
getErrorMessages()
A list of error messages generated from the validation attempt or an emptyStringList
if no errors occurred during the validation attempt.boolean
getIsSchemaSpecified()
[schema specified]ShortList
getItemValueTypes()
In the case the actual value represents a list, i.e.XSSimpleTypeDefinition
getMemberTypeDefinition()
If and only if that type definition is a simple type definition with {variety} union, or a complex type definition whose {content type} is a simple thype definition with {variety} union, then an item isomorphic to that member of the union's {member type definitions} which actually validated the element item's normalized value.String
getSchemaDefault()
[schema default]String
getSchemaNormalizedValue()
[schema normalized value]XSValue
getSchemaValue()
If this item has a simple type definition or a complex type with simple content, then return the value with respect to the simple type.XSTypeDefinition
getTypeDefinition()
An item isomorphic to the type definition used to validate this element.short
getValidationAttempted()
Determines the extent to which the document has been validatedString
getValidationContext()
The nearest ancestor element information item with a[schema information]
property (or this element item itself if it has such a property).short
getValidity()
Determine the validity of the node with respect to the validation being attemptedboolean
isConstant()
Returnstrue
if this specific instance ofItemPSVI
is immutable, otherwisefalse
.void
reset()
Reset()
-
-
-
Field Detail
-
fDeclaration
protected XSAttributeDeclaration fDeclaration
attribute declaration
-
fTypeDecl
protected XSTypeDefinition fTypeDecl
type of attribute, simpleType
-
fSpecified
protected boolean fSpecified
If this attribute was explicitly given a value in the original document, this is false; otherwise, it is true
-
fValue
protected ValidatedInfo fValue
Schema value
-
fValidationAttempted
protected short fValidationAttempted
validation attempted: none, partial, full
-
fValidity
protected short fValidity
validity: valid, invalid, unknown
-
fErrors
protected String[] fErrors
error codes and error messages
-
fValidationContext
protected String fValidationContext
validation context: could be QName or XPath expression
-
fIsConstant
protected boolean fIsConstant
true if this object is immutable
-
-
Constructor Detail
-
AttributePSVImpl
public AttributePSVImpl()
-
AttributePSVImpl
public AttributePSVImpl(boolean isConstant, AttributePSVI attrPSVI)
-
-
Method Detail
-
constant
public ItemPSVI constant()
Description copied from interface:ItemPSVI
Returns a reference to an immutable instance with the same data that this instance ofItemPSVI
currently has.
-
isConstant
public boolean isConstant()
Description copied from interface:ItemPSVI
Returnstrue
if this specific instance ofItemPSVI
is immutable, otherwisefalse
.- Specified by:
isConstant
in interfaceItemPSVI
-
getSchemaDefault
public String getSchemaDefault()
[schema default]- Specified by:
getSchemaDefault
in interfaceItemPSVI
- Returns:
- The canonical lexical representation of the declaration's {value constraint} value.
- See Also:
-
-
getSchemaNormalizedValue
public String getSchemaNormalizedValue()
[schema normalized value]- Specified by:
getSchemaNormalizedValue
in interfaceItemPSVI
- Returns:
- the normalized value of this item after validation
- See Also:
-
-
getIsSchemaSpecified
public boolean getIsSchemaSpecified()
[schema specified]- Specified by:
getIsSchemaSpecified
in interfaceItemPSVI
- Returns:
- true - value was specified in schema, false - value comes from the infoset
- See Also:
- XML Schema Part 1: Structures [schema specified]
-
getValidationAttempted
public short getValidationAttempted()
Determines the extent to which the document has been validated- Specified by:
getValidationAttempted
in interfaceItemPSVI
- Returns:
- return the [validation attempted] property. The possible values are NO_VALIDATION, PARTIAL_VALIDATION and FULL_VALIDATION
-
getValidity
public short getValidity()
Determine the validity of the node with respect to the validation being attempted- Specified by:
getValidity
in interfaceItemPSVI
- Returns:
- return the [validity] property. Possible values are: UNKNOWN_VALIDITY, INVALID_VALIDITY, VALID_VALIDITY
-
getErrorCodes
public StringList getErrorCodes()
A list of error codes generated from validation attempts. Need to find all the possible subclause reports that need reporting- Specified by:
getErrorCodes
in interfaceItemPSVI
- Returns:
- list of error codes
-
getErrorMessages
public StringList getErrorMessages()
A list of error messages generated from the validation attempt or an emptyStringList
if no errors occurred during the validation attempt. The indices of error messages in this list are aligned with those in the[schema error code]
list.- Specified by:
getErrorMessages
in interfaceItemPSVI
-
getValidationContext
public String getValidationContext()
Description copied from interface:ItemPSVI
The nearest ancestor element information item with a[schema information]
property (or this element item itself if it has such a property). For more information refer to element validation context and attribute validation context .- Specified by:
getValidationContext
in interfaceItemPSVI
-
getTypeDefinition
public XSTypeDefinition getTypeDefinition()
An item isomorphic to the type definition used to validate this element.- Specified by:
getTypeDefinition
in interfaceItemPSVI
- Returns:
- a type declaration
-
getMemberTypeDefinition
public XSSimpleTypeDefinition getMemberTypeDefinition()
If and only if that type definition is a simple type definition with {variety} union, or a complex type definition whose {content type} is a simple thype definition with {variety} union, then an item isomorphic to that member of the union's {member type definitions} which actually validated the element item's normalized value.- Specified by:
getMemberTypeDefinition
in interfaceItemPSVI
- Returns:
- a simple type declaration
-
getAttributeDeclaration
public XSAttributeDeclaration getAttributeDeclaration()
An item isomorphic to the attribute declaration used to validate this attribute.- Specified by:
getAttributeDeclaration
in interfaceAttributePSVI
- Returns:
- an attribute declaration
-
getActualNormalizedValue
public Object getActualNormalizedValue()
Description copied from interface:ItemPSVI
[schema normalized value]
: Binding specific actual value ornull
if the value is in error.- Specified by:
getActualNormalizedValue
in interfaceItemPSVI
-
getActualNormalizedValueType
public short getActualNormalizedValueType()
Description copied from interface:ItemPSVI
The actual value built-in datatype, e.g.STRING_DT, SHORT_DT
. If the type definition of this value is a list type definition, this method returnsLIST_DT
. If the type definition of this value is a list type definition whose item type is a union type definition, this method returnsLISTOFUNION_DT
. To query the actual value of the list or list of union type definitions useitemValueTypes
. If theactualNormalizedValue
isnull
, this method returnsUNAVAILABLE_DT
.- Specified by:
getActualNormalizedValueType
in interfaceItemPSVI
-
getItemValueTypes
public ShortList getItemValueTypes()
Description copied from interface:ItemPSVI
In the case the actual value represents a list, i.e. theactualNormalizedValueType
isLIST_DT
, the returned array consists of one type kind which represents the itemType . For example:<simpleType name="listtype"> <list itemType="positiveInteger"/> </simpleType> <element name="list" type="listtype"/> ... <list>1 2 3</list>
TheschemaNormalizedValue
value is "1 2 3", theactualNormalizedValueType
value isLIST_DT
, and theitemValueTypes
is an array of size 1 with the valuePOSITIVEINTEGER_DT
.
If the actual value represents a list type definition whose item type is a union type definition, i.e.LISTOFUNION_DT
, for each actual value in the list the array contains the corresponding memberType kind. For example:<simpleType name='union_type' memberTypes="integer string"/> <simpleType name='listOfUnion'> <list itemType='union_type'/> </simpleType> <element name="list" type="listOfUnion"/> ... <list>1 2 foo</list>
TheschemaNormalizedValue
value is "1 2 foo", theactualNormalizedValueType
isLISTOFUNION_DT
, and theitemValueTypes
is an array of size 3 with the following values:INTEGER_DT, INTEGER_DT, STRING_DT
.- Specified by:
getItemValueTypes
in interfaceItemPSVI
-
getSchemaValue
public XSValue getSchemaValue()
Description copied from interface:ItemPSVI
If this item has a simple type definition or a complex type with simple content, then return the value with respect to the simple type. If this item doesn't have a simple-typed value, the behavior of this method is not specified.- Specified by:
getSchemaValue
in interfaceItemPSVI
-
reset
public void reset()
Reset()
-
-
-
-