net.sourceforge.nrl.parser.model.xsd
Class XSDAttribute

java.lang.Object
  extended by net.sourceforge.nrl.parser.model.AbstractAttribute
      extended by net.sourceforge.nrl.parser.model.xsd.XSDAttribute
All Implemented Interfaces:
IAttribute

public class XSDAttribute
extends AbstractAttribute

An NRL attribute created from a schema sub-element or attribute. Note again, "attribute" refers to how NRL sees an attribute.


Field Summary
 
Fields inherited from interface net.sourceforge.nrl.parser.model.IAttribute
UNBOUNDED
 
Constructor Summary
XSDAttribute(String name)
           
XSDAttribute(org.eclipse.xsd.XSDAttributeUse use)
          Initialise from a schema attribute use declaration.
XSDAttribute(org.eclipse.xsd.XSDElementDeclaration decl, int minOccurs, int maxOccurs)
          Initialise from an element declaration.
 
Method Summary
 void addDocumentation(String doc)
           
 List<String> getDocumentation()
          Return any documentation associated with the attribute.
 int getMaxOccurs()
          Return the maximum number of occurrences of the attribute (0 or more).
 int getMinOccurs()
          Return the minimum number of occurrences of the attribute (0 or more).
 String getTypeName()
           
 boolean isStatic()
          Returns true if the attribute is static, or if it is an enum value.
 void setMaxOccurs(int maxOccurs)
           
 void setMinOccurs(int minOccurs)
           
 void setStatic(boolean _static)
           
 void setTypeName(String typeName)
           
 void setXSDType(org.eclipse.xsd.XSDTypeDefinition typeDef)
           
 
Methods inherited from class net.sourceforge.nrl.parser.model.AbstractAttribute
getName, getOriginalName, getOwner, getType, getUserData, isRepeating, setName, setOriginalName, setOwner, setType, setUserData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSDAttribute

public XSDAttribute(String name)

XSDAttribute

public XSDAttribute(org.eclipse.xsd.XSDAttributeUse use)
Initialise from a schema attribute use declaration. Sets the name, occurrence and type name.

Parameters:
use - the attribute use declaration

XSDAttribute

public XSDAttribute(org.eclipse.xsd.XSDElementDeclaration decl,
                    int minOccurs,
                    int maxOccurs)
Initialise from an element declaration. This initialises the name and type name;

Parameters:
decl - the declaration
minOccurs - the minOccurs value in the XSD library format
maxOccurs - the maxOccurs value in the XSD library format
Method Detail

addDocumentation

public void addDocumentation(String doc)

getDocumentation

public List<String> getDocumentation()
Description copied from interface: IAttribute
Return any documentation associated with the attribute.

Returns:
the documentation or an empty list

getMaxOccurs

public int getMaxOccurs()
Description copied from interface: IAttribute
Return the maximum number of occurrences of the attribute (0 or more).

Returns:
the occurrences

getMinOccurs

public int getMinOccurs()
Description copied from interface: IAttribute
Return the minimum number of occurrences of the attribute (0 or more).

Returns:
the occurrences

isStatic

public boolean isStatic()
Description copied from interface: IAttribute
Returns true if the attribute is static, or if it is an enum value.

Returns:
true if static

setMaxOccurs

public void setMaxOccurs(int maxOccurs)

setMinOccurs

public void setMinOccurs(int minOccurs)

setStatic

public void setStatic(boolean _static)

getTypeName

public String getTypeName()

setTypeName

public void setTypeName(String typeName)

setXSDType

public void setXSDType(org.eclipse.xsd.XSDTypeDefinition typeDef)


Copyright © 2006-2010 Christian Nentwich and others