<commit_before>package com.parc.ccn.data.content;

import javax.xml.stream.XMLStreamException;

import com.parc.ccn.data.ContentName;
import com.parc.ccn.data.security.LinkAuthenticator;
import com.parc.ccn.data.util.GenericXMLEncodable;
import com.parc.ccn.data.util.XMLDecoder;
import com.parc.ccn.data.util.XMLEncodable;
import com.parc.ccn.data.util.XMLEncoder;

/**
 * Mapping from a link to the underlying XML representation.
 * Basically a Link is a content object containing
 * a name and optionally some content authentication
 * information to specify whose value for the name
 * to take.
 * @author smetters
 *
 */
public class LinkReference extends GenericXMLEncodable implements XMLEncodable {
	
	protected static final String LINK_ELEMENT = "Link";
	protected static final String LABEL_ELEMENT = "Label"; // overlaps with WrappedKey.LABEL_ELEMENT,
															// shared dictionary entry
	
	protected ContentName _targetName;<commit_msg>CCNEncodableObject wrapper around link. Will be renamed as link and replace separate Link class.<commit_after>package com.parc.ccn.data.content;

import java.io.IOException;

import javax.xml.stream.XMLStreamException;

import com.parc.ccn.config.ConfigurationException;
import com.parc.ccn.data.ContentName;
import com.parc.ccn.data.security.LinkAuthenticator;
import com.parc.ccn.data.util.CCNEncodableObject;
import com.parc.ccn.data.util.GenericXMLEncodable;
import com.parc.ccn.data.util.XMLDecoder;
import com.parc.ccn.data.util.XMLEncodable;
import com.parc.ccn.data.util.XMLEncoder;
import com.parc.ccn.library.CCNLibrary;

/**
 * Mapping from a link to the underlying XML representation.
 * Basically a Link is a content object containing
 * a name and optionally some content authentication
 * information to specify whose value for the name
 * to take.
 * @author smetters
 *
 */
public class LinkReference extends GenericXMLEncodable implements XMLEncodable {
	
	protected static final String LINK_ELEMENT = "Link";
	protected static final String LABEL_ELEMENT = "Label"; // overlaps with WrappedKey.LABEL_ELEMENT,
															// shared dictionary entry
	
	public static class LinkObject extends CCNEncodableObject<LinkReference> {

		public LinkObject() throws ConfigurationException, IOException {
			super(LinkReference.class);
		}
		
		public LinkObject(ContentName name, CCNLibrary library) throws XMLStreamException, IOException {
			super(LinkReference.class, name, library);
		}

		public LinkObject(ContentName name) throws XMLStreamException, IOException, ConfigurationException {
			super(LinkReference.class, name);
		}
		public LinkObject(ContentName name, LinkReference linkReference, CCNLibrary library) {
			super(LinkReference.class, name, linkReference, library);
		}

		public LinkObject(ContentName name, LinkReference linkReference) throws ConfigurationException, IOException {
			super(LinkReference.class, name, linkReference);
		}
		
		public LinkReference link() { return data(); }
	}

	
	protected ContentName _targetName;
{'fraction_non_alphanumeric': 0.08123342175066313, 'fraction_numerical': 0.0, 'mean_word_length': 4.904109589041096, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3103303', 'n_tokens_mistral': 932, 'n_tokens_neox': 860, 'n_words': 239}