/** * Copyright © World Wide Web Consortium, (Massachusetts Institute of * Technology, Institut National de Recherche en Informatique et en * Automatique, Keio University). * * All Rights Reserved. * * Please see the full Copyright clause at * * * $Log: Literal.java,v $ * Revision 1.2 1999/05/04 14:52:43 jsaarela * Literal value now tells if it is well-formed XML. * Improved entity management in Data nodes. * * Revision 1.1 1999/04/01 09:32:34 jsaarela * SiRPAC distribution release V1.11 on 1-Apr-99 * * * @author Janne Saarela */ package org.w3c.rdf; public class Literal extends RDFnode { private String m_sLiteral; private boolean m_bXML = false; private String m_sXMLlang = new String ("undefined"); public Literal() { m_sLiteral = "undefined"; } public Literal(String sLiteral) { m_sLiteral = sLiteral; } public Literal(String sLiteral, boolean bXML) { m_sLiteral = sLiteral; m_bXML = bXML; } public void setLiteral (String sLiteral) { m_sLiteral = sLiteral; } public String getLiteral () { return m_sLiteral; } public String toString () { return m_sLiteral; } /** * Is the literal well-formed XML markup? */ public boolean isXML () { return m_bXML; } /** * The language of a literal can be managed separately * from the RDF data model with the xml:lang attribute */ public void setXMLlang (String sLang) { m_sXMLlang = sLang; } public String getXMLlang () { return m_sXMLlang; } public boolean equals (Literal l) { return l.toString().equals (m_sLiteral); } }