Java Code Examples for org.w3c.dom.TypeInfo

The following are top voted examples for showing how to use org.w3c.dom.TypeInfo. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: openjdk-jdk10   File: Bug4966143.java   View source code 6 votes vote down vote up
@Test
public void test1() throws Exception {
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setNamespaceAware(true);
    dbf.setValidating(true);
    dbf.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI);
    dbf.setAttribute(SCHEMA_SOURCE, Bug4966143.class.getResource("Bug4966143.xsd").toExternalForm());

    Document document = dbf.newDocumentBuilder().parse(Bug4966143.class.getResource("Bug4966143.xml").toExternalForm());

    TypeInfo type = document.getDocumentElement().getSchemaTypeInfo();

    Assert.assertFalse(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_UNION));
    Assert.assertFalse(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_LIST));
    Assert.assertFalse(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_RESTRICTION));
    Assert.assertTrue(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_EXTENSION));
    Assert.assertTrue(type.isDerivedFrom("testNS", "Test", 0));
}
 
Example 2
Project: openjdk-jdk10   File: Bug4966138.java   View source code 6 votes vote down vote up
@Test
public void test1() throws Exception {
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setNamespaceAware(true);
    dbf.setValidating(true);
    dbf.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI);
    dbf.setAttribute(SCHEMA_SOURCE, Bug4966138.class.getResource("test.xsd").toExternalForm());

    Document document = dbf.newDocumentBuilder().parse(Bug4966138.class.getResource("test.xml").toExternalForm());

    TypeInfo type = document.getDocumentElement().getSchemaTypeInfo();

    String typeName = type.getTypeName();
    System.out.println(typeName);
    Assert.assertNotNull(typeName);
    Assert.assertTrue(typeName.length() != 0, "returned typeName shouldn't be empty");

    String typeNs = type.getTypeNamespace();
    System.out.println(typeNs);
    Assert.assertNotNull(typeNs);
    Assert.assertTrue(typeNs.length() != 0, "returned typeNamespace shouldn't be empty");
}
 
Example 3
Project: openjdk-jdk10   File: AuctionController.java   View source code 6 votes vote down vote up
/**
 * Check usage of TypeInfo interface introduced in DOM L3.
 *
 * @throws Exception If any errors occur.
 */
@Test
public void testGetTypeInfo() throws Exception {
    String xmlFile = XML_DIR + "accountInfo.xml";

    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setNamespaceAware(true);
    dbf.setValidating(true);
    dbf.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA_NS_URI);

    DocumentBuilder docBuilder = dbf.newDocumentBuilder();
    docBuilder.setErrorHandler(new MyErrorHandler());

    Document document = docBuilder.parse(xmlFile);
    Element userId = (Element)document.getElementsByTagNameNS(PORTAL_ACCOUNT_NS, "UserID").item(0);
    TypeInfo typeInfo = userId.getSchemaTypeInfo();
    assertTrue(typeInfo.getTypeName().equals("nonNegativeInteger"));
    assertTrue(typeInfo.getTypeNamespace().equals(W3C_XML_SCHEMA_NS_URI));

    Element role = (Element)document.getElementsByTagNameNS(PORTAL_ACCOUNT_NS, "Role").item(0);
    TypeInfo roletypeInfo = role.getSchemaTypeInfo();
    assertTrue(roletypeInfo.getTypeName().equals("BuyOrSell"));
    assertTrue(roletypeInfo.getTypeNamespace().equals(PORTAL_ACCOUNT_NS));
}
 
Example 4
Project: openjdk9   File: Bug4966143.java   View source code 6 votes vote down vote up
@Test
public void test1() throws Exception {
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setNamespaceAware(true);
    dbf.setValidating(true);
    dbf.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI);
    dbf.setAttribute(SCHEMA_SOURCE, Bug4966143.class.getResource("Bug4966143.xsd").toExternalForm());

    Document document = dbf.newDocumentBuilder().parse(Bug4966143.class.getResource("Bug4966143.xml").toExternalForm());

    TypeInfo type = document.getDocumentElement().getSchemaTypeInfo();

    Assert.assertFalse(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_UNION));
    Assert.assertFalse(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_LIST));
    Assert.assertFalse(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_RESTRICTION));
    Assert.assertTrue(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_EXTENSION));
    Assert.assertTrue(type.isDerivedFrom("testNS", "Test", 0));
}
 
Example 5
Project: openjdk9   File: Bug4966138.java   View source code 6 votes vote down vote up
@Test
public void test1() throws Exception {
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setNamespaceAware(true);
    dbf.setValidating(true);
    dbf.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI);
    dbf.setAttribute(SCHEMA_SOURCE, Bug4966138.class.getResource("test.xsd").toExternalForm());

    Document document = dbf.newDocumentBuilder().parse(Bug4966138.class.getResource("test.xml").toExternalForm());

    TypeInfo type = document.getDocumentElement().getSchemaTypeInfo();

    String typeName = type.getTypeName();
    System.out.println(typeName);
    Assert.assertNotNull(typeName);
    Assert.assertTrue(typeName.length() != 0, "returned typeName shouldn't be empty");

    String typeNs = type.getTypeNamespace();
    System.out.println(typeNs);
    Assert.assertNotNull(typeNs);
    Assert.assertTrue(typeNs.length() != 0, "returned typeNamespace shouldn't be empty");
}
 
Example 6
Project: openjdk9   File: AuctionController.java   View source code 6 votes vote down vote up
/**
 * Check usage of TypeInfo interface introduced in DOM L3.
 *
 * @throws Exception If any errors occur.
 */
@Test(groups = {"readLocalFiles"})
public void testGetTypeInfo() throws Exception {
    String xmlFile = XML_DIR + "accountInfo.xml";

    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setNamespaceAware(true);
    dbf.setValidating(true);
    dbf.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA_NS_URI);

    DocumentBuilder docBuilder = dbf.newDocumentBuilder();
    docBuilder.setErrorHandler(new MyErrorHandler());

    Document document = docBuilder.parse(xmlFile);
    Element userId = (Element)document.getElementsByTagNameNS(PORTAL_ACCOUNT_NS, "UserID").item(0);
    TypeInfo typeInfo = userId.getSchemaTypeInfo();
    assertTrue(typeInfo.getTypeName().equals("nonNegativeInteger"));
    assertTrue(typeInfo.getTypeNamespace().equals(W3C_XML_SCHEMA_NS_URI));

    Element role = (Element)document.getElementsByTagNameNS(PORTAL_ACCOUNT_NS, "Role").item(0);
    TypeInfo roletypeInfo = role.getSchemaTypeInfo();
    assertTrue(roletypeInfo.getTypeName().equals("BuyOrSell"));
    assertTrue(roletypeInfo.getTypeNamespace().equals(PORTAL_ACCOUNT_NS));
}
 
Example 7
Project: javify   File: XMLSchemaTypeInfo.java   View source code 6 votes vote down vote up
protected boolean simpleTypeIsDerivedFrom(SimpleType simpleType,
                                          String typeNamespace,
                                          String typeName,
                                          int derivationMethod)
{
  switch (derivationMethod)
    {
    case TypeInfo.DERIVATION_RESTRICTION:
      SimpleType baseType = simpleType.baseType;
      while (baseType != null)
        {
          if (baseType.name.getNamespaceURI().equals(typeNamespace) &&
              baseType.name.getLocalPart().equals(typeName))
            {
              return true;
            }
          baseType = baseType.baseType;
        }
      break;
      // TODO other methods
    }
  return false;
}
 
Example 8
Project: jvm-stm   File: XMLSchemaTypeInfo.java   View source code 6 votes vote down vote up
protected boolean simpleTypeIsDerivedFrom(SimpleType simpleType,
                                          String typeNamespace,
                                          String typeName,
                                          int derivationMethod)
{
  switch (derivationMethod)
    {
    case TypeInfo.DERIVATION_RESTRICTION:
      SimpleType baseType = simpleType.baseType;
      while (baseType != null)
        {
          if (baseType.name.getNamespaceURI().equals(typeNamespace) &&
              baseType.name.getLocalPart().equals(typeName))
            {
              return true;
            }
          baseType = baseType.baseType;
        }
      break;
      // TODO other methods
    }
  return false;
}
 
Example 9
Project: JamVM-PH   File: XMLSchemaTypeInfo.java   View source code 6 votes vote down vote up
protected boolean simpleTypeIsDerivedFrom(SimpleType simpleType,
                                          String typeNamespace,
                                          String typeName,
                                          int derivationMethod)
{
  switch (derivationMethod)
    {
    case TypeInfo.DERIVATION_RESTRICTION:
      SimpleType baseType = simpleType.baseType;
      while (baseType != null)
        {
          if (baseType.name.getNamespaceURI().equals(typeNamespace) &&
              baseType.name.getLocalPart().equals(typeName))
            {
              return true;
            }
          baseType = baseType.baseType;
        }
      break;
      // TODO other methods
    }
  return false;
}
 
Example 10
Project: wso2-axis2   File: XMLStreamReaderFromDOM.java   View source code 6 votes vote down vote up
public String getAttributeType(int index) {
    String attrType = null;    
    Attr attr = (Attr)getAttributes().get(index);
    TypeInfo typeInfo = attr.getSchemaTypeInfo();
 if (typeInfo != null) {
 	attrType = typeInfo.getTypeName();
    }
 
    if (attrType == null) {
        try {
            attrType = (String) attr.getUserData(SAAJConverter.OM_ATTRIBUTE_KEY);
            if (log.isDebugEnabled()) {
            	log.debug("Retrieving attrType from UserData: " + attrType);
            }
        } catch (Exception e) {
       	    if (log.isDebugEnabled()) {
     		    log.debug("An error occured while getting attrType: " + e.getMessage());
     	    }
        }
    }
          
    return attrType;
}
 
Example 11
Project: classpath   File: XMLSchemaTypeInfo.java   View source code 6 votes vote down vote up
protected boolean simpleTypeIsDerivedFrom(SimpleType simpleType,
                                          String typeNamespace,
                                          String typeName,
                                          int derivationMethod)
{
  switch (derivationMethod)
    {
    case TypeInfo.DERIVATION_RESTRICTION:
      SimpleType baseType = simpleType.baseType;
      while (baseType != null)
        {
          if (baseType.name.getNamespaceURI().equals(typeNamespace) &&
              baseType.name.getLocalPart().equals(typeName))
            {
              return true;
            }
          baseType = baseType.baseType;
        }
      break;
      // TODO other methods
    }
  return false;
}
 
Example 12
Project: hybris-integration-intellij-idea-plugin   File: XSDModelLoader.java   View source code 5 votes vote down vote up
public String toJavaTypeName(XSObject xs, Map<String, NamespaceDesc> nsdMap) {
    String name = xs.getName();
    if (name == null) {
        if (xs instanceof TypeInfo) {
            name = ((TypeInfo) xs).getTypeName();
            if (name != null && name.startsWith("#")) {
                name = name.substring(1);
            }
        }
    }
    return model.toJavaTypeName(name, xs.getNamespace());
}
 
Example 13
Project: OpenJSharp   File: ElementImpl.java   View source code 5 votes vote down vote up
/**
     * Method getSchemaTypeInfo.
     * @return TypeInfo
     */
public TypeInfo getSchemaTypeInfo(){
    if(needsSyncData()) {
        synchronizeData();
    }
    return this;
}
 
Example 14
Project: OpenJSharp   File: ValidatorHandlerImpl.java   View source code 5 votes vote down vote up
private TypeInfo getAttributeType( int index ) {
    checkState(false);
    if( index<0 || fAttributes.getLength()<=index )
        throw new IndexOutOfBoundsException(Integer.toString(index));
    Augmentations augs = fAttributes.getAugmentations(index);
    if (augs == null) return null;
    AttributePSVI psvi = (AttributePSVI)augs.getItem(Constants.ATTRIBUTE_PSVI);
    return getTypeInfoFromPSVI(psvi);
}
 
Example 15
Project: openjdk-jdk10   File: ElementImpl.java   View source code 5 votes vote down vote up
/**
 * Method getSchemaTypeInfo.
 *
 * @return TypeInfo
 */
public TypeInfo getSchemaTypeInfo() {
    if (needsSyncData()) {
        synchronizeData();
    }
    return this;
}
 
Example 16
Project: openjdk-jdk10   File: ValidatorHandlerImpl.java   View source code 5 votes vote down vote up
private TypeInfo getAttributeType( int index ) {
    checkState(false);
    if( index<0 || fAttributes.getLength()<=index )
        throw new IndexOutOfBoundsException(Integer.toString(index));
    Augmentations augs = fAttributes.getAugmentations(index);
    if (augs == null) return null;
    AttributePSVI psvi = (AttributePSVI)augs.getItem(Constants.ATTRIBUTE_PSVI);
    return getTypeInfoFromPSVI(psvi);
}
 
Example 17
Project: openjdk-jdk10   File: Bug4966142.java   View source code 5 votes vote down vote up
@Test
public void test1() throws Exception {
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setNamespaceAware(true);
    dbf.setValidating(true);
    dbf.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI);
    dbf.setAttribute(SCHEMA_SOURCE, Bug4966142.class.getResource("Bug4966142.xsd").toExternalForm());

    Document document = dbf.newDocumentBuilder().parse(Bug4966142.class.getResource("Bug4966142.xml").toExternalForm());

    TypeInfo type = document.getDocumentElement().getSchemaTypeInfo();

    Assert.assertFalse(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_UNION));
}
 
Example 18
Project: openjdk-jdk10   File: TypeInfoTest.java   View source code 5 votes vote down vote up
@Test
public void test() throws Exception {
    TypeInfo typeInfo = getTypeOfRoot(SCHEMA_INSTANCE, "<?xml version='1.0'?>\n" + "<test1 xmlns=\"testNS\"><code/></test1>\n");

    assertEquals(typeInfo.getTypeName(), "Test");
    assertEquals(typeInfo.getTypeNamespace(), "testNS");

}
 
Example 19
Project: openjdk9   File: ElementImpl.java   View source code 5 votes vote down vote up
/**
 * Method getSchemaTypeInfo.
 *
 * @return TypeInfo
 */
public TypeInfo getSchemaTypeInfo() {
    if (needsSyncData()) {
        synchronizeData();
    }
    return this;
}
 
Example 20
Project: openjdk9   File: ValidatorHandlerImpl.java   View source code 5 votes vote down vote up
private TypeInfo getAttributeType( int index ) {
    checkState(false);
    if( index<0 || fAttributes.getLength()<=index )
        throw new IndexOutOfBoundsException(Integer.toString(index));
    Augmentations augs = fAttributes.getAugmentations(index);
    if (augs == null) return null;
    AttributePSVI psvi = (AttributePSVI)augs.getItem(Constants.ATTRIBUTE_PSVI);
    return getTypeInfoFromPSVI(psvi);
}
 
Example 21
Project: openjdk9   File: Bug4966142.java   View source code 5 votes vote down vote up
@Test
public void test1() throws Exception {
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setNamespaceAware(true);
    dbf.setValidating(true);
    dbf.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI);
    dbf.setAttribute(SCHEMA_SOURCE, Bug4966142.class.getResource("Bug4966142.xsd").toExternalForm());

    Document document = dbf.newDocumentBuilder().parse(Bug4966142.class.getResource("Bug4966142.xml").toExternalForm());

    TypeInfo type = document.getDocumentElement().getSchemaTypeInfo();

    Assert.assertFalse(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_UNION));
}
 
Example 22
Project: openjdk9   File: TypeInfoTest.java   View source code 5 votes vote down vote up
@Test
public void test() throws Exception {
    TypeInfo typeInfo = getTypeOfRoot(SCHEMA_INSTANCE, "<?xml version='1.0'?>\n" + "<test1 xmlns=\"testNS\"><code/></test1>\n");

    assertEquals(typeInfo.getTypeName(), "Test");
    assertEquals(typeInfo.getTypeNamespace(), "testNS");

}
 
Example 23
Project: Push2Display   File: AbstractElement.java   View source code 5 votes vote down vote up
/**
 * <b>DOM</b>: Implements {@link org.w3c.dom.Element#getSchemaTypeInfo()}.
 */
public TypeInfo getSchemaTypeInfo() {
    if (typeInfo == null) {
        typeInfo = new ElementTypeInfo();
    }
    return typeInfo;
}
 
Example 24
Project: Push2Display   File: AbstractAttr.java   View source code 5 votes vote down vote up
/**
 * <b>DOM</b>: Implements {@link org.w3c.dom.Attr#getSchemaTypeInfo()}.
 */
public TypeInfo getSchemaTypeInfo() {
    if (typeInfo == null) {
        typeInfo = new AttrTypeInfo();
    }
    return typeInfo;
}
 
Example 25
Project: lookaside_java-1.8.0-openjdk   File: ElementImpl.java   View source code 5 votes vote down vote up
/**
     * Method getSchemaTypeInfo.
     * @return TypeInfo
     */
public TypeInfo getSchemaTypeInfo(){
    if(needsSyncData()) {
        synchronizeData();
    }
    return this;
}
 
Example 26
Project: lookaside_java-1.8.0-openjdk   File: ValidatorHandlerImpl.java   View source code 5 votes vote down vote up
private TypeInfo getAttributeType( int index ) {
    checkState(false);
    if( index<0 || fAttributes.getLength()<=index )
        throw new IndexOutOfBoundsException(Integer.toString(index));
    Augmentations augs = fAttributes.getAugmentations(index);
    if (augs == null) return null;
    AttributePSVI psvi = (AttributePSVI)augs.getItem(Constants.ATTRIBUTE_PSVI);
    return getTypeInfoFromPSVI(psvi);
}
 
Example 27
Project: javify   File: XIncludeFilter.java   View source code 5 votes vote down vote up
public String getAttributeType(int index)
{
  if (current != null)
    {
      NamedNodeMap attrs = current.getAttributes();
      if (attrs == null)
       return null;
      Attr attr = (Attr) attrs.item(index);
      TypeInfo ti = attr.getSchemaTypeInfo();
      return (ti == null) ? "CDATA" : ti.getTypeName();
    }
  return super.getAttributeType(index);
}
 
Example 28
Project: javify   File: DomAttr.java   View source code 5 votes vote down vote up
public TypeInfo getSchemaTypeInfo()
{
  if (parent != null)
    {
      // DTD implementation
      DomDoctype doctype = (DomDoctype) parent.owner.getDoctype();
      if (doctype != null)
        {
          return doctype.getAttributeTypeInfo(parent.getNodeName(),
                                              getNodeName());
        }
      // TODO XML Schema implementation
    }
  return null;
}
 
Example 29
Project: javify   File: DomElement.java   View source code 5 votes vote down vote up
public TypeInfo getSchemaTypeInfo()
{
  // DTD implementation
  DomDoctype doctype = (DomDoctype) owner.getDoctype();
  if (doctype != null)
    {
      return doctype.getElementTypeInfo(getNodeName());
    }
  // TODO XML Schema implementation
  return null;
}
 
Example 30
Project: intellij-ce-playground   File: XSDModelLoader.java   View source code 5 votes vote down vote up
public String toJavaTypeName(XSObject xs, Map<String, NamespaceDesc> nsdMap) {
  String name = xs.getName();
  if (name == null) {
    if (xs instanceof TypeInfo) {
      name = ((TypeInfo) xs).getTypeName();
      if (name != null && name.startsWith("#")) {
        name = name.substring(1);
      }
    }
  }
  return model.toJavaTypeName(name, xs.getNamespace());
}
 
Example 31
Project: jvm-stm   File: XIncludeFilter.java   View source code 5 votes vote down vote up
public String getAttributeType(int index)
{
  if (current != null)
    {
      NamedNodeMap attrs = current.getAttributes();
      if (attrs == null)
       return null;
      Attr attr = (Attr) attrs.item(index);
      TypeInfo ti = attr.getSchemaTypeInfo();
      return (ti == null) ? "CDATA" : ti.getTypeName();
    }
  return super.getAttributeType(index);
}
 
Example 32
Project: jvm-stm   File: DomAttr.java   View source code 5 votes vote down vote up
public TypeInfo getSchemaTypeInfo()
{
  if (parent != null)
    {
      // DTD implementation
      DomDoctype doctype = (DomDoctype) parent.owner.getDoctype();
      if (doctype != null)
        {
          return doctype.getAttributeTypeInfo(parent.getNodeName(),
                                              getNodeName());
        }
      // TODO XML Schema implementation
    }
  return null;
}
 
Example 33
Project: jvm-stm   File: DomElement.java   View source code 5 votes vote down vote up
public TypeInfo getSchemaTypeInfo()
{
  // DTD implementation
  DomDoctype doctype = (DomDoctype) owner.getDoctype();
  if (doctype != null)
    {
      return doctype.getElementTypeInfo(getNodeName());
    }
  // TODO XML Schema implementation
  return null;
}
 
Example 34
Project: Push2Display   File: AbstractElement.java   View source code 5 votes vote down vote up
/**
 * <b>DOM</b>: Implements {@link org.w3c.dom.Element#getSchemaTypeInfo()}.
 */
public TypeInfo getSchemaTypeInfo() {
    if (typeInfo == null) {
        typeInfo = new ElementTypeInfo();
    }
    return typeInfo;
}
 
Example 35
Project: Push2Display   File: AbstractAttr.java   View source code 5 votes vote down vote up
/**
 * <b>DOM</b>: Implements {@link org.w3c.dom.Attr#getSchemaTypeInfo()}.
 */
public TypeInfo getSchemaTypeInfo() {
    if (typeInfo == null) {
        typeInfo = new AttrTypeInfo();
    }
    return typeInfo;
}
 
Example 36
Project: Lucee4   File: XMLElementStruct.java   View source code 5 votes vote down vote up
public TypeInfo getSchemaTypeInfo() {
   	// dynamic load to support jre 1.4 and 1.5
	try {
		Method m = element.getClass().getMethod("getSchemaTypeInfo", new Class[]{});
		return (TypeInfo) m.invoke(element, ArrayUtil.OBJECT_EMPTY);
	} 
	catch (Exception e) {
		throw new PageRuntimeException(Caster.toPageException(e));
	}
}
 
Example 37
Project: infobip-open-jdk-8   File: ElementImpl.java   View source code 5 votes vote down vote up
/**
     * Method getSchemaTypeInfo.
     * @return TypeInfo
     */
public TypeInfo getSchemaTypeInfo(){
    if(needsSyncData()) {
        synchronizeData();
    }
    return this;
}
 
Example 38
Project: infobip-open-jdk-8   File: ValidatorHandlerImpl.java   View source code 5 votes vote down vote up
private TypeInfo getAttributeType( int index ) {
    checkState(false);
    if( index<0 || fAttributes.getLength()<=index )
        throw new IndexOutOfBoundsException(Integer.toString(index));
    Augmentations augs = fAttributes.getAugmentations(index);
    if (augs == null) return null;
    AttributePSVI psvi = (AttributePSVI)augs.getItem(Constants.ATTRIBUTE_PSVI);
    return getTypeInfoFromPSVI(psvi);
}
 
Example 39
Project: Lucee   File: XMLElementStruct.java   View source code 5 votes vote down vote up
public TypeInfo getSchemaTypeInfo() {
   	// dynamic load to support jre 1.4 and 1.5
	try {
		Method m = element.getClass().getMethod("getSchemaTypeInfo", new Class[]{});
		return (TypeInfo) m.invoke(element, ArrayUtil.OBJECT_EMPTY);
	} 
	catch (Exception e) {
		throw new PageRuntimeException(Caster.toPageException(e));
	}
}
 
Example 40
Project: feathers-sdk   File: AbstractElement.java   View source code 5 votes vote down vote up
/**
 * <b>DOM</b>: Implements {@link org.w3c.dom.Element#getSchemaTypeInfo()}.
 */
public TypeInfo getSchemaTypeInfo() {
    if (typeInfo == null) {
        typeInfo = new ElementTypeInfo();
    }
    return typeInfo;
}